[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 18:20:13 +0100 (CET) |
On Wed, 6 Nov 2002, Lynn Winebarger wrote:
> On Wednesday 06 November 2002 01:54, Dirk Herrmann wrote:
> > 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?
>
> "Syntax error: invalid use of define" or "Syntax error: invalid define
> form"?
I think this is not general enough. It works for the special case of
define, but the point is not, that the define form is broken, but that a
macro is used as an argument to something else. Consider
(call-foo define)
The point that we have to decide is, whether such a form is reported as a
syntax error during memoization, or whether we just don't dereference the
macro during memoization and let the executor do the lookup. The second
choice will allow that a new definition of the macro may be provided in
the meantime. For example:
(define (foo) (call-foo and))
(define and #t)
(foo)
Should this be possible? If so, then can't signal an error
_during_memoization_ if a macro is used at some illegal place.
Best regards,
Dirk