Added fluid-let-syntax.

See http://www.scheme.com/csug7/syntax.html#./syntax:s15
for details.
This commit is contained in:
Abdulaziz Ghuloum 2008-02-25 02:15:51 -05:00
parent 7a9526ec91
commit c8f9b1dc3d
3 changed files with 21 additions and 0 deletions

Binary file not shown.

View File

@ -125,6 +125,7 @@
[unless (core-macro . unless)]
[parameterize (core-macro . parameterize)]
[case (core-macro . case)]
[fluid-let-syntax (core-macro . fluid-let-syntax)]
[record-type-descriptor (core-macro . record-type-descriptor)]
[record-constructor-descriptor (core-macro . record-constructor-descriptor)]
[let-values (macro . let-values)]
@ -589,6 +590,7 @@
[let*-values i r ba]
[let-syntax i r ba se ne]
[let-values i r ba]
[fluid-let-syntax i]
[letrec i r ba se ne]
[letrec* i r ba]
[letrec-syntax i r ba se ne]

View File

@ -863,6 +863,24 @@
(define letrec*-transformer
(lambda (e r mr) (letrec-helper e r mr build-letrec*)))
(define fluid-let-syntax-transformer
(lambda (e r mr)
(define (lookup x)
(or (id->label x)
(syntax-violation #f "unbound identifier" e x)))
(syntax-match e ()
((_ ((lhs* rhs*) ...) b b* ...)
(if (not (valid-bound-ids? lhs*))
(invalid-fmls-error e lhs*)
(let ([lab* (map lookup lhs*)]
[rhs* (map (lambda (x)
(make-eval-transformer
(expand-transformer x mr)))
rhs*)])
(chi-internal (cons b b*)
(append (map cons lab* rhs*) r)
(append (map cons lab* rhs*) mr))))))))
(define type-descriptor-transformer
(lambda (e r mr)
(syntax-match e ()
@ -2423,6 +2441,7 @@
((type-descriptor) type-descriptor-transformer)
((record-type-descriptor) record-type-descriptor-transformer)
((record-constructor-descriptor) record-constructor-descriptor-transformer)
((fluid-let-syntax) fluid-let-syntax-transformer)
(else (assertion-violation
'macro-transformer
"BUG: cannot find transformer"