[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] Re: #511: Expander problem with "declare" triggered b
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] Re: #511: Expander problem with "declare" triggered by snowtar |
Date: |
Sat, 19 Feb 2011 16:21:54 -0000 |
#511: Expander problem with "declare" triggered by snowtar
-----------------------+----------------------------------------------------
Reporter: sjamaan | Owner: felix
Type: defect | Status: assigned
Priority: critical | Milestone: 4.7.0
Component: expander | Version: 4.6.x
Resolution: | Keywords: declare, macro-expanded code
-----------------------+----------------------------------------------------
Changes (by sjamaan):
* owner: sjamaan => felix
* status: new => assigned
Comment:
Turns out this has nothing to do with "declare" after all, but it was a
bug in my patch for #379 (forgot to rename "-")
It turns out that even renaming it properly does not help - because the
library imports an global identifier called "{{{-}}}", that will always be
used. If this is a bug, we should really look at that! I suppose it may
not really be a bug as syntax-rules is a macro-generating macro; it would
have to have some way to refer to the definition of {{{-}}} at the
definition site of syntax-rules, not at the definition site of the macro
that it generates (I hope this makes sense... *My* head almost
exploded...).
Another example is that I was unable to rename "length" in such a way that
it couldn't be captured like this:
{{{
(module capture (length)
(import chicken (only scheme define car))
(define (length x)
(car x)))
(module foo (bar)
(import chicken scheme capture)
(define-syntax def
(syntax-rules ()
((_ name value ...)
(define (name) (list value ...)))))
(def bar 1))
}}}
I had to work around that by adding a "safe" {{{##sys#length}}} to
{{{library.scm}}}. The minus I simply changed to plus, and added -1 to the
value. Alternatively, I could've done the same as for length, to add
{{{##sys#-}}} to {{{library.scm}}}.
These immediate bugs in syntax-rules have been fixed in changeset 0eb8724
of the {{{expander-simplifications}}} branch; I've also removed a couple
of unused local definitions there.
We should check that the non-{{{##sys#}}}-prefixed identifiers like the
special forms {{{and}}} and such -- but also the free identifiers like
{{{compare}}} and such! --
--
Ticket URL: <http://bugs.call-cc.org/ticket/511#comment:2>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #511: Expander problem with "declare" triggered by snowtar, Chicken Trac, 2011/02/19
- [Chicken-janitors] Re: #511: Expander problem with "declare" triggered by snowtar, Chicken Trac, 2011/02/19
- [Chicken-janitors] Re: #511: Expander problem with "declare" triggered by snowtar,
Chicken Trac <=
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports (was: Expander problem with "declare" triggered by snowtar), Chicken Trac, 2011/02/19
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/19
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/19
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/19
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/20
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/20
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/20
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/20
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/22
- [Chicken-janitors] Re: #511: Syntax-rules expansion uses unprefixed identifiers which can be captured by module imports, Chicken Trac, 2011/02/22