Exemplo n.º 1
0
Obj GAP_ElmRecord(Obj rec, Obj name)
{
    UInt rnam = RNamObj(name);
    if (ISB_REC(rec, rnam))
        return ELM_REC(rec, rnam);
    return 0;
}
Exemplo n.º 2
0
Arquivo: records.c Projeto: vbraun/gap
Obj             IsbRecHandler (
    Obj                 self,
    Obj                 rec,
    Obj                 rnam )
{
    return (ISB_REC( rec, INT_INTOBJ(rnam) ) ? True : False);
}
Exemplo n.º 3
0
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);
}
Exemplo n.º 4
0
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 );
}
Exemplo n.º 5
0
// 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");
}
Exemplo n.º 6
0
 bool has(const char* c)
 {
   UInt n = RNamName(c);
   return ISB_REC(record, n);
 }
Exemplo n.º 7
0
 bool hasOrbit() const
 { return ISB_REC(sc, RName_orbit); }
Exemplo n.º 8
0
 bool hasNextLevel() const
 { return ISB_REC(sc, RName_stabilizer); }