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