guile-devel
[Top][All Lists]
Advanced

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

Re: memoization and conditional defines


From: Dirk Herrmann
Subject: Re: memoization and conditional defines
Date: Sat, 9 Nov 2002 09:19:09 +0100 (CET)

On Thu, 7 Nov 2002, Lynn Winebarger wrote:

> On Thursday 07 November 2002 19:46, Bruce Korb wrote:
> > 
> > It will be a bit of a nuisance when the (if <test> (define <foo> <bar>))
> > stuff chokes, but I would expect a sensible error message that will
> > lead me to wrapping that stuff in an eval once its encountered, yes?
> 
>      Depends on how it's implemented.  It doesn't have to be an error
> per se, but the _binding_ (as opposed to the side-effecting) of the
> variable would happen before the test was evaluated.  That's probably 
> _not_ the behaviour you'd expect from that construct.  
>      If it's made an error, I don't know what the actual error message 
> would be.  There are only a few types of places defines are really
> legitimate:  at the top level, at the head of a body, inside a begin
> clause in any other legitimate location (recursively) - but only
> before non-defines in a body occurence (following macro expansion).

If we are going to disallow defininitions except when on the real top
level, then it is easy to issue an error message when something like
  (if <test> (define <foo> <bar>))
is encountered.  Guile could, for example, issue an error message like
  "bad define placement"
or even
  "bad define placement.  Read guile's documentation about definitions to
understand why this is not allowed."
or something similar.  I hope this would be good enough for Bruce's
purposes.

Best regards,
Dirk Herrmann





reply via email to

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