This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Internal defines


Marius Vollmer <mvo@zagadka.ping.de> writes:

> Lauri Alanko <la@iki.fi> writes:
> 
> > I just wouldn't much like an extra level of indentation.. is there
> > any way to implement some kind of a define* macro that would
> > transform the body of a lambda into a let* expression? Or what would
> > be the best way to get what I want?
> 
> My preferred way would be to rewrite internal defines into a letrec*
> where letrec* is the same as letrec but with the sequential
> initialisation semantics of let*.
> 
> But this woul require changes to Guile itself and so is probably of no
> help to you right now.
> 
> What do others think?  Would such a change be welcome?

As I've said before, I do think the idea itself is very good, and if
there was no Scheme standard I'd say the change would be very welcome.

But there is a standard which clearly specifies how internal defines
should behave, and it says they should behave as `letrec'.  I'm
entirely convinced that making Guile incompatible in this respect
would cause more harm than good.  It's quite easy to write code in a
way that you don't need the `letrec*' property of internal defines.
It's very difficult, however, to be sure that your code is portable if
the interpreter allows for more freedom than the standard.  As support
for this claim, I take the flood of messages and bug-reports than the
"rewrite to letrec" change caused.  If people write code for Guile,
they should be able to trust that it at least basically is Scheme.  Of
course, some primitives will be extensions, but that is easier to
be aware of than the exact behaviour of basic language constructs.

So, given a standard which says `letrec', I'm very much against
changing it to `letrec*'.

But, I'd be glad to see the standard change to `letrec*'.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]