diff --git a/src/syntax.c b/src/syntax.c index fc94535..9de72bf 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -46,7 +46,7 @@ struct Object *syntax_define( struct Object *const environment ) { assert(Object_is_pair(environment)); - assert(OBJECT_IS_NULL(environment->pair.cdr)); + assert(OBJECT_IS_LIST_HEAD(environment->pair.cdr)); assert(OBJECT_IS_LIST_HEAD(environment->pair.car)); assert(Object_is_pair(args)); diff --git a/tests/syntax.scm b/tests/syntax.scm index 973a40e..24b691e 100644 --- a/tests/syntax.scm +++ b/tests/syntax.scm @@ -24,6 +24,13 @@ (define (sum a b) (+ a b)) (define (inc a) (+ a 1)) (sum (inc 1) (inc 2)))) +(assert-equal + 11 + (begin + (define (make-inc const-num) (lambda (var-num) (+ var-num const-num))) + (define inc1 (make-inc 1)) + (define inc10 (make-inc 10)) + (inc1 (inc10 0)))) ;;; if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (assert-equal 123 (if #true 123 456))