diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-08-04 22:02:49 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-08-04 22:02:49 -0700 |
| commit | 37c646859f2382fe003d0a95cc274414ba84f36c (patch) | |
| tree | 5d4e217855b362a001a72a4981a85459f76b22f5 /lib/csc | |
| parent | Add begin. (diff) | |
| download | chromatopelma-37c646859f2382fe003d0a95cc274414ba84f36c.tar.zst | |
Add if, and, or, when and friends.
Diffstat (limited to 'lib/csc')
| -rw-r--r-- | lib/csc/macros.csc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/csc/macros.csc b/lib/csc/macros.csc index d41e9da..fc72f74 100644 --- a/lib/csc/macros.csc +++ b/lib/csc/macros.csc @@ -802,6 +802,16 @@ (_ (raise-syntax-error "unexpected form in builtin-if")))))) + (define builtin-sequence + (make-macro-transformer + (lambda (x) + (syntax-case x + ((_ head tail) + (make-sequence (expand-syntax-object head) + (expand-syntax-object tail))) + (_ (raise-syntax-error "unexpected form in builtin-sequence")))))) + + (define builtins-environment (alist->substitutions (list (cons 'syntax-rules builtin-syntax-rules) @@ -814,7 +824,8 @@ (cons 'define-syntax builtin-define-syntax) (cons 'call-builtin builtin-call-builtin) (cons 'set! builtin-set) - (cons 'builtin-if builtin-if)))) + (cons 'builtin-if builtin-if) + (cons 'builtin-sequence builtin-sequence)))) ; Expands the body of a library, or top level. expand-body can be thought |
