[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Syntax-rules seems not to rename identifiers correctly
From: |
Alexey Bakhirkin |
Subject: |
[Chicken-users] Syntax-rules seems not to rename identifiers correctly |
Date: |
Mon, 1 Jun 2009 19:48:02 +0400 |
;This is sample code (also can be found in attachment):
(define-syntax define/bug
(syntax-rules ()
((_ name foo-value)
(begin
(define foo foo-value) ;Here we introduce a binding to "foo" and
expect it not to be visible as "foo" outside macro definition.
(define name
(lambda () foo))))))
(define/bug first "first")
(display foo)(newline) ;Displays "first", but "foo" is not
expected to be defined at all. Seems, that the macro does not rename
it.
(display (first))(newline) ;Displays "first" as expected
(define/bug second "second")
(display (second))(newline) ;Displays "second" as expected
(display foo)(newline) ;Displays "second". The second macro
expansion redefines "foo".
(display (first))(newline) ;Displays "second". So, both macros
share one "foo".
chicken-bug-report.2009-05-01
Description: Binary data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Chicken-users] Syntax-rules seems not to rename identifiers correctly,
Alexey Bakhirkin <=