(spar-classifier->runtime
(delay
(spar-call-with-values
- (lambda (ctx bindings body-ctx body)
- (let ((frame-senv (make-internal-senv (serror-ctx-senv ctx)))
- (ids (map car bindings)))
- (for-each (lambda (id)
- (reserve-identifier id frame-senv))
- ids)
- (for-each (lambda (id item)
- (bind-keyword id frame-senv item))
- ids
- (map (lambda (binding)
- ((cdr binding) frame-senv))
- bindings))
- (seq-item body-ctx (body frame-senv))))
- (spar-subform)
- (spar-push spar-arg:ctx)
- (spar-subform
+ (lambda (ctx bindings body-ctx body)
+ (let ((frame-senv (make-internal-senv (serror-ctx-senv ctx)))
+ (ids (map car bindings)))
+ (for-each (lambda (id)
+ (reserve-identifier id frame-senv))
+ ids)
+ (for-each (lambda (id item)
+ (bind-keyword id frame-senv item))
+ ids
+ (map (lambda (binding)
+ ((cdr binding) frame-senv))
+ bindings))
+ (seq-item body-ctx (body frame-senv))))
+ (spar-subform)
+ (spar-push spar-arg:ctx)
+ (spar-subform
(spar-call-with-values list
(spar*
(spar-call-with-values cons
(spar-match-null))
(spar-push-body)))))
\f
+;;;; Pseudo keywords
+
+(define (pseudo-keyword-classifier form senv hist)
+ (serror (serror-ctx form senv hist)
+ "Special keyword can't be expanded:" form))
+
+(define $...
+ (classifier->runtime pseudo-keyword-classifier))
+
+(define $=>
+ (classifier->runtime pseudo-keyword-classifier))
+
+(define $_
+ (classifier->runtime pseudo-keyword-classifier))
+
+(define $else
+ (classifier->runtime pseudo-keyword-classifier))
+
+(define $unquote
+ (classifier->runtime pseudo-keyword-classifier))
+
+(define $unquote-splicing
+ (classifier->runtime pseudo-keyword-classifier))
+\f
;;;; MIT-specific syntax
(define $access
(files "mit-syntax")
(parent (runtime syntax))
(export ()
+ (... $...) ;R7RS
+ (=> $=>) ;R7RS
+ (_ $_) ;R7RS
(access $access)
(begin $begin) ;R7RS
(declare $declare)
(define-syntax $define-syntax) ;R7RS
- (delay $delay) ;R7RS
+ (delay $delay) ;R7RS
+ (else $else) ;R7RS
(er-macro-transformer $er-macro-transformer)
(if $if) ;R7RS
(lambda $lambda) ;R7RS
(sc-macro-transformer $sc-macro-transformer)
(set! $set!) ;R7RS
(spar-macro-transformer $spar-macro-transformer)
- (the-environment $the-environment))
+ (the-environment $the-environment)
+ (unquote $unquote) ;R7RS
+ (unquote-splicing $unquote-splicing) ;R7RS
+ )
(export (runtime mit-macros)
keyword:define
keyword:let-syntax