Obj GAP_ElmRecord(Obj rec, Obj name) { UInt rnam = RNamObj(name); if (ISB_REC(rec, rnam)) return ELM_REC(rec, rnam); return 0; }
Obj IsbRecHandler ( Obj self, Obj rec, Obj rnam ) { return (ISB_REC( rec, INT_INTOBJ(rnam) ) ? True : False); }
Obj GAP_get_rec(Obj rec, UInt n) { if(!IS_REC(rec)) throw GAPException("Invalid attempt to read record"); if(!ISB_REC(rec, n)) throw GAPException(std::string("Unable to read value from rec")); return ELM_REC(rec, n); }
static Int IsbRecError(Obj rec, UInt rnam) { rec = ErrorReturnObj( "Record IsBound: <rec> must be a record (not a %s)", (Int)TNAM_OBJ(rec), 0L, "you can replace <rec> via 'return <rec>;'" ); return ISB_REC( rec, rnam ); }
// This is a special method. It gets a boolean from a record, and assumes // it is 'false' if not present bool GAP_get_maybe_bool_rec(Obj rec, UInt n) { if(!IS_REC(rec)) throw GAPException("Invalid attempt to read record"); if(!ISB_REC(rec, n)) return false; Obj b = ELM_REC(rec, n); if(b == True) return true; if(b == False) return false; throw GAPException("Record element is not a boolean"); }
bool has(const char* c) { UInt n = RNamName(c); return ISB_REC(record, n); }
bool hasOrbit() const { return ISB_REC(sc, RName_orbit); }
bool hasNextLevel() const { return ISB_REC(sc, RName_stabilizer); }