Unified · Split
| @@ -54,6 +54,7 @@ boolean? · 53 unmodified lines | ||
| 54 | 54 | defined? |
| 55 | 55 | eq? |
| 56 | 56 | nan? |
| 57 | +null? | |
| 57 | 58 | number? |
| 58 | 59 | string? |
| 59 | 60 | ``` |
| @@ -133,6 +133,7 @@ static aaObject rparen; · 132 unmodified lines | ||
| 133 | 133 | static char prelude[] = "\ |
| 134 | 134 | (define newline (lambda () (display \"\\n\")))\ |
| 135 | 135 | (define square (lambda (x) (* x x)))\ |
| 136 | +(define null? (lambda (x) (eq? x ())))\ | |
| 136 | 137 | "; |
| 137 | 138 | |
| 138 | 139 | static aaObject *eval(aaContext *ctx, aaObject *obj, aaObject *env, aaObject **bind); |
| @@ -29,3 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | (test '(and #t #t) #t) |
| 30 | 30 | (test '(and #f #t) #f) |
| 31 | 31 | (test '(and #t #f) #f) |
| 32 | +(test '(null? ()) #t) | |
| 33 | +(test '(null? #f) #f) | |
| 34 | +(test '(null? (list () ())) #f) | |