mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-20 06:09:17 +02:00
Issue #331 - Ensure definitions from begin's are spliced in
This commit is contained in:
parent
2d398573a5
commit
80b861664a
1 changed files with 20 additions and 18 deletions
|
@ -614,17 +614,19 @@
|
|||
rename-env
|
||||
local-renamed))))))
|
||||
(cond
|
||||
; ;; special case
|
||||
; ((eq? 'begin op)
|
||||
;; special case - a begin can splice in definitions, so we can't use the
|
||||
;; built-in macro that just expands them in a new lambda scope. Instead
|
||||
;; we nest them below within the same lexical environment.
|
||||
((eq? 'begin op)
|
||||
;(newline)
|
||||
;(display "/* ")
|
||||
;(write (list 'begin exp))
|
||||
;(write (list exp))
|
||||
;(display "*/ ")
|
||||
; (let ((fncs (map (lambda (expr)
|
||||
; (pre-analyze-application expr a-env rename-env local-renamed))
|
||||
; (cdr exp))))
|
||||
; (lambda (env)
|
||||
; (foldl (lambda (fnc _) (fnc env)) #f fncs))))
|
||||
(let ((fncs (map (lambda (expr)
|
||||
(analyze expr a-env rename-env local-renamed))
|
||||
(cdr exp))))
|
||||
(lambda (env)
|
||||
(foldl (lambda (fnc _) (fnc env)) #f fncs))))
|
||||
;; compiled macro
|
||||
((Cyc-macro? var)
|
||||
(expand var))
|
||||
|
|
Loading…
Add table
Reference in a new issue