add letrec-syntax

This commit is contained in:
Yuichi Nishiwaki 2014-07-16 14:30:45 +09:00
parent b1962ef61b
commit b86d010b76
2 changed files with 14 additions and 1 deletions

View File

@ -58,7 +58,7 @@ section status comments
5.3.1 Top level definitions yes
5.3.2 Internal definitions yes TODO: interreferential definitions
5.3.3 Multiple-value definitions yes
5.4 Syntax definitions yes TODO: internal macro definition is not supported.
5.4 Syntax definitions yes
5.5 Recored-type definitions yes
5.6.1 Library Syntax incomplete In picrin, libraries can be reopend and can be nested.
5.6.2 Library example N/A

View File

@ -292,6 +292,17 @@
`(,(r 'begin) ,@(cdar clauses)))
,(loop (cdr clauses))))))))))
(define-syntax letrec-syntax
(er-macro-transformer
(lambda (form r c)
(let ((formal (car (cdr form)))
(body (cdr (cdr form))))
`(let ()
,@(map (lambda (x)
`(,(r 'define-syntax) ,(car x) ,(cadr x)))
formal)
,@body)))))
(define-syntax syntax-error
(er-macro-transformer
(lambda (expr rename compare)
@ -317,6 +328,7 @@
and or
cond case else =>
do when unless
letrec-syntax
_ ... syntax-error))
@ -629,6 +641,7 @@
and or
cond case else =>
do when unless
letrec-syntax
_ ... syntax-error)
(export let-values