From b94b0450645a3739c26e5bc99bfeba3304eb95c4 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Thu, 7 Apr 2022 19:32:07 -0700 Subject: Add libraries. Gone is toplevel. Now everyone lives in a library. --- csc/macros-test.csc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'csc/macros-test.csc') diff --git a/csc/macros-test.csc b/csc/macros-test.csc index 23a9cfc..6211131 100644 --- a/csc/macros-test.csc +++ b/csc/macros-test.csc @@ -9,7 +9,10 @@ lexical-set-name lexical-set? make-constant + make-lexical-ref make-lambda-case + make-letrec + make-library-ref void?) (only (csc testing) assert-equal @@ -175,12 +178,28 @@ builtins-environment))) -(test builtin-case-lambda +(test builtin-case-lambda-cases (assert-equal ir1=? - (make-lambda-case '(x y z) #f #f (make-constant 5) - (make-lambda-case '(a b c) 'd #f (make-constant 6) '())) + (make-lambda-case '(x y z) #f #f (make-sequence (make-void) (make-constant 5)) + (make-lambda-case '(a b c) 'd #f (make-sequence (make-void) (make-constant 6)) '())) (expand '(case-lambda ((x y z) (quote 5)) ((a b c . d) (quote 6))) builtins-environment))) + + +(test builtin-case-lambda-defines + (assert-equal ir1=? + (make-lambda-case '(x) #f #f + (make-letrec #t '(a b) #f + (list (make-constant 6) + (make-lexical-ref 'a #f)) + (make-sequence (make-void) (make-constant 7)))) + (expand + '(case-lambda + ((x) + (builtin-define a (quote 6)) + (builtin-define b a) + (quote 7))) + builtins-environment))) -- cgit v1.3.1