Esempio n. 1
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);
}
Esempio n. 2
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");
}
Esempio n. 3
0
 GAPRecord(Obj o) : record(o)
 {
   if(!IS_REC(o))
     throw GAPException("Not a record");
 }
Esempio n. 4
0
 bool isa(Obj recval) const
 { return IS_REC(recval); }
Esempio n. 5
0
int GAP_IsRecord(Obj obj)
{
    return obj && IS_REC(obj);
}
Esempio n. 6
0
static Obj FiltIS_REC(Obj self, Obj obj)
{
    return (IS_REC(obj) ? True : False);
}
Esempio n. 7
0
File: records.c Progetto: vbraun/gap
Obj             IsRecHandler (
    Obj                 self,
    Obj                 obj )
{
    return (IS_REC(obj) ? True : False);
}