[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: define and modules
From: |
Dirk Herrmann |
Subject: |
Re: define and modules |
Date: |
Wed, 6 Nov 2002 07:54:41 +0100 (CET) |
On 4 Nov 2002, Marius Vollmer wrote:
> Dirk Herrmann <address@hidden> writes:
>
> > OK, talking about the right thing: How should guile react to the
> > following code:
> >
> > (define define-private define)
> >
> > This is done in boot9.scm. Should this be allowed?
>
> No, since 'define' is a syntactic keyword... which is probably not the
> reason you were expecting, right?
It is exactly the reason. The question is, how should guile react here?
Or, what should a memoizer do with this code? I currently just leave the
symbol define where it is, that is my memoizer makes
(address@hidden define-private define)
from that expression. This results then in a 'unbound symbol' error,
since the executor does not care for macros any more. This solution makes
sense if the example is slightly different:
(begin
(define and #t)
(define foo and))
Here, the memoizer would first memoize the code to:
(address@hidden
(address@hidden and #t)
(address@hidden foo and))
and the executor would find a valid non-macro definition for 'and' when it
tries to execute the definition for 'foo'.
So, what do you think should be guile's behaviour?
Best regards
Dirk