guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: illegal uses of define in guile


From: tomas
Subject: Re: illegal uses of define in guile
Date: Tue, 15 Oct 2002 12:49:22 +0200
User-agent: Mutt/1.3.24i

On Tue, Oct 15, 2002 at 08:15:17AM +0200, Dirk Herrmann wrote:
> On Mon, 14 Oct 2002, Bruce Korb wrote:
> 
> > Neil Jerram wrote:
> > 
> > >     >> Currently, guile allows the following:
> > >     >> (if (not (defined? '%load-verbosely))
> > >     >> (define %load-verbosely #f))
> > > 
> > >     Bruce> I do that.

[...]

> I wonder what people's objective is when they use these constructs?  Do
> you really want to construct two different top-level environments, where
> once the symbol has a definition and once it has not?  Are you (mis)using
> the definedness of a symbol as a means to communicate boolean values?

I'd second Bruce here. Static code analysis should first make sure that
`important' things are not re-bound, but basically allow anything. If
I loose optimisation, so be it -- but I wouldn't like to lose flexibility.

I understand that the optimiser can't try to guess all the way down
whether `define' has been redefined. It might often fail to the
conservative side. I see two ways to deal with it:

  (a) programmer promises: special forms whereby I swear that this
    thing won't change. Reminds me a bit of C++ :-/
    (but still better than nothing).

  (b) have a look at what those folks do with partial evaluation
    (the general `monster' solution).

  (c) stripped down versions of (b). Is it possible to assume in
    general that some things don't change (and make it possible,
    if more expensive, that they change?) and give the possibility
    of an (external) package which will do the full code analysis
    if requested?

> Do other scheme implementations allow this?

I don't know for sure, but I'd be tempted to state:

  "For all feature f there is a Scheme implementation..."

(you get the idea ;)

Regards
-- tomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]