[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] hygienic branch (progress report, sort of)
From: |
Jim Ursetto |
Subject: |
Re: [Chicken-users] hygienic branch (progress report, sort of) |
Date: |
Mon, 26 May 2008 10:12:17 -0600 |
Possible bug? Despite lambda being renamed in define's definition
in expand.scm, it seems to break hygiene:
(let ((lambda 3)) (define (foo x) x))
Error: unbound variable: x
Call history:
<syntax> (let280 ((foo (##core#undefined)))
(##core#set! foo (lambda278 (x) x)))
<syntax> (begin282 (##core#set! foo (lambda278 (x) x)))
<syntax> (##core#set! foo (lambda278 (x) x))
<syntax> (lambda278 (x) x)
Yet renaming works in general:
#;3> (##sys#extend-macro-environment 'def '()
(##sys#er-transformer (lambda (f r c) `(,(r 'define) (foo) 3))))
#;4> ,x (def)
(##core#set! foo (lambda () 3))
#;4> (let ((define 0)) (def) (foo)) ;; ok
3
#;5> (let ((lambda 0)) (def) (foo)) ;; fail
Error: illegal non-atomic object: ()
However if we manually do the core expansion of
(define (foo) ...) => (define foo (lambda () ...))
then the result is correct:
#;6> (##sys#extend-macro-environment 'def '()
(##sys#er-transformer (lambda (f r c)
`(,(r 'define) foo (,(r 'lambda) () 3)))))
#;7> ,x (def)
(##core#set! foo (lambda () 3))
#;7> (let ((lambda 0)) (def) (foo)) ;; ok
3
Weird.
On 5/14/08, felix winkelmann <address@hidden> wrote:
> Please feel free to ask questions and please report any bugs you'll
> find. I will update the manual and announce it once I'm ready. You
> can look in tests/module-tests.scm and of course the sources for first
> hints at how things work.
- Re: [Chicken-users] hygienic branch (progress report, sort of), (continued)
- Re: [Chicken-users] hygienic branch (progress report, sort of), Peter Bex, 2008/05/14
- Re: [Chicken-users] hygienic branch (progress report, sort of), Ivan Raikov, 2008/05/14
- Re: [Chicken-users] hygienic branch (progress report, sort of), Alaric Snell-Pym, 2008/05/15
- Re: [Chicken-users] hygienic branch (progress report, sort of), Hans Bulfone, 2008/05/16
- Re: [Chicken-users] hygienic branch (progress report, sort of), Andrew Gwozdziewycz, 2008/05/16
- Re: [Chicken-users] hygienic branch (progress report, sort of),
Jim Ursetto <=
- Re: [Chicken-users] hygienic branch (progress report, sort of), felix winkelmann, 2008/05/27