mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Handle renamed syntax-rules when expanding define-syntax
This commit is contained in:
parent
f40232e9eb
commit
23e67294ec
2 changed files with 9 additions and 9 deletions
|
@ -887,7 +887,7 @@
|
|||
(trans (caddr exp))
|
||||
(body (cadr trans)))
|
||||
(cond
|
||||
((tagged-list? 'syntax-rules trans) ;; TODO: what if syntax-rules is renamed?
|
||||
((macro:syntax-rules? (env:lookup (car trans) env #f)) ;; Handles renamed 'syntax-rules' identifier
|
||||
(_expand
|
||||
`(define-syntax ,name ,(_expand trans env rename-env local-env))
|
||||
env rename-env local-env))
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
; ((my-when test result1 result2 ...)
|
||||
; (if test
|
||||
; (begin result1 result2 ...)))))
|
||||
;
|
||||
;(define-syntax my-when2
|
||||
; (syntax-rules ()
|
||||
; ((my-when test result1 result2 ...)
|
||||
; (list result2 ...))))
|
||||
;
|
||||
;;(write
|
||||
;; (my-when2 #t 1))
|
||||
|
||||
(define-syntax my-when2
|
||||
(syntax-rules ()
|
||||
((my-when test result1 result2 ...)
|
||||
(list result2 ...))))
|
||||
|
||||
(write
|
||||
(my-when2 #t 1))
|
||||
;
|
||||
; (define my-when2*
|
||||
; (lambda (expr$28 rename$29 compare$30)
|
||||
|
|
Loading…
Add table
Reference in a new issue