Esempio n. 1
0
int isTrue(Expression* cond)
{
    // the only thing false is nil
    ListNode* nval = cond->isList();
    if (nval && nval->isNil())
    {
        return 0;
    }
    return 1;
}
Esempio n. 2
0
int APLValue::size()
{
    int sz = 1;
    for (ListNode* n = shapedata; !n->isNil(); n = n->tail())
    {
        IntegerExpression* extent = n->head()->isInteger();
        if (extent)
        {
            sz *= extent->val();
        }
    }
    return sz;
}