diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-06-28 15:58:36 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-06-28 15:58:36 -0700 |
| commit | fed28363fb60266c030a0f6b30d5a9d697774ee0 (patch) | |
| tree | 50ed1ec9663371220559e4d4bfc7b1cd1bcb7117 /csc/macros-test.csc | |
| parent | Finish CPS. (diff) | |
| download | chromatopelma-fed28363fb60266c030a0f6b30d5a9d697774ee0.tar.zst | |
Improve CPS.
Goodbye soup. Thanks to "Compiling with Continuations" by Appel.
Diffstat (limited to 'csc/macros-test.csc')
| -rw-r--r-- | csc/macros-test.csc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/csc/macros-test.csc b/csc/macros-test.csc index fd9d1ae..db78324 100644 --- a/csc/macros-test.csc +++ b/csc/macros-test.csc @@ -8,7 +8,6 @@ lexical-set-expression lexical-set? make-constant - make-lambda-case make-letrec make-lexical-ref make-library-ref @@ -177,28 +176,30 @@ builtins-environment))) -(test builtin-case-lambda-cases +(test builtin-lambda-rest (assert-equal ir1=? - (make-lambda-case '(x y z) #f #f (make-sequence (make-constant #f) (make-constant 5)) - (make-lambda-case '(a b c) 'd #f (make-sequence (make-constant #f) (make-constant 6)) '())) + (make-lambda (list + (make-lexical-ref 'a #f) + (make-lexical-ref 'b #f) + (make-lexical-ref 'c #f)) + (make-lexical-ref 'd #f) + (make-sequence (make-constant #f) (make-constant 5))) (expand - '(case-lambda - ((x y z) (quote 5)) - ((a b c . d) (quote 6))) + '(lambda + (a b c . d) (quote 5)) builtins-environment))) (test builtin-case-lambda-defines (assert-equal ir1=? - (make-lambda-case '(x) #f #f + (make-lambda (list (make-lexical-ref 'x #f)) #f (make-letrec #t '(a b) #f (list (make-constant 6) (make-lexical-ref 'a #f)) - (make-sequence (make-constant #f) (make-constant 7))) '()) + (make-sequence (make-constant #f) (make-constant 7)))) (expand - '(case-lambda - ((x) - (builtin-define a (quote 6)) - (builtin-define b a) - (quote 7))) + '(lambda (x) + (builtin-define a (quote 6)) + (builtin-define b a) + (quote 7)) builtins-environment))) |
