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
|
rename-env
|
||||||
local-renamed))))))
|
local-renamed))))))
|
||||||
(cond
|
(cond
|
||||||
; ;; special case
|
;; special case - a begin can splice in definitions, so we can't use the
|
||||||
; ((eq? 'begin op)
|
;; 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)
|
;(newline)
|
||||||
;(display "/* ")
|
;(display "/* ")
|
||||||
;(write (list 'begin exp))
|
;(write (list exp))
|
||||||
;(display "*/ ")
|
;(display "*/ ")
|
||||||
; (let ((fncs (map (lambda (expr)
|
(let ((fncs (map (lambda (expr)
|
||||||
; (pre-analyze-application expr a-env rename-env local-renamed))
|
(analyze expr a-env rename-env local-renamed))
|
||||||
; (cdr exp))))
|
(cdr exp))))
|
||||||
; (lambda (env)
|
(lambda (env)
|
||||||
; (foldl (lambda (fnc _) (fnc env)) #f fncs))))
|
(foldl (lambda (fnc _) (fnc env)) #f fncs))))
|
||||||
;; compiled macro
|
;; compiled macro
|
||||||
((Cyc-macro? var)
|
((Cyc-macro? var)
|
||||||
(expand var))
|
(expand var))
|
||||||
|
|
Loading…
Add table
Reference in a new issue