History

add null? predicate

Sigrid Haflínudóttir committed 6 years ago

Commit 826176d1 parent b31989b3 files · +5 −0Browse files

Unified · Split

3 files
  1. README.md +1 −0
  2. aa.c +1 −0
  3. test.scm +3 −0
README.md+1−0
@@ -54,6 +54,7 @@ boolean? · 53 unmodified lines
54defined?54defined?
55eq?55eq?
56nan?56nan?
57null?
57number?58number?
58string?59string?
59```60```
aa.c+1−0
@@ -133,6 +133,7 @@ static aaObject rparen; · 132 unmodified lines
133static char prelude[] = "\133static 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
138static aaObject *eval(aaContext *ctx, aaObject *obj, aaObject *env, aaObject **bind);139static aaObject *eval(aaContext *ctx, aaObject *obj, aaObject *env, aaObject **bind);
test.scm+3−0
@@ -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)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t