Unified · Split
| @@ -8,6 +8,7 @@ · 7 unmodified lines | |||
| 8 | #define TAG(x) ( (x)->car.c ) | 8 | #define TAG(x) ( (x)->car.c ) |
| 9 | #define ISNIL(x) ( (x) == &Nil ) | 9 | #define ISNIL(x) ( (x) == &Nil ) |
| 10 | #define ISTRUE(x) ( (x) == &True ) | 10 | #define ISTRUE(x) ( (x) == &True ) |
| 11 | #define ISFALSE(x) ( (x) == &False ) | ||
| 11 | #define TYPE(x) ( TAG(x) & 0x1 ? TAG(x) >> 2 : AA_TPAIR ) | 12 | #define TYPE(x) ( TAG(x) & 0x1 ? TAG(x) >> 2 : AA_TPAIR ) |
| 12 | #define SETTYPE(x,t) ( TAG(x) = (t) << 2 | 1 ) | 13 | #define SETTYPE(x,t) ( TAG(x) = (t) << 2 | 1 ) |
| 13 | #define NUMBER(x) ( (x)->cdr.n ) | 14 | #define NUMBER(x) ( (x)->cdr.n ) |
| @@ -775,7 +776,7 @@ eval(aaContext *ctx, aaObject *obj, aaObject *env, aaObject **newenv) · 761 unmodified lines | |||
| 775 | case P_IF: | 776 | case P_IF: |
| 776 | while(!ISNIL(arg)){ | 777 | while(!ISNIL(arg)){ |
| 777 | va = evalarg(); | 778 | va = evalarg(); |
| 778 | if(!ISNIL(va)){ | 779 | if(!ISFALSE(va)){ |
| 779 | res = ISNIL(arg) ? va : evalarg(); | 780 | res = ISNIL(arg) ? va : evalarg(); |
| 780 | break; | 781 | break; |
| 781 | } | 782 | } |