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

macros expanding into definitions



> > Personally, I would favor a semantics for internal definitions that is
> > closer to toplevel definitions:
> 
> > 1) Definitions are evaluated in order.
> > 2) They can be intermixed with non-definitions.
> > 3) A redefinition of a variable is legal and equivalent to a set!
> 
> I like the fact that internal defines are just sugar for letrec, and
> I'm not sure we should give this up.  Maybe we should be looking for a
> way to make top-level definitions more like internal definitions.

Let's not forget that letrec isn't exactly "clean" since it is just
sugar for let and set! (as currently defined anyway).  I don't view
the one-to-one correspondence between letrec and internal defines as
being very useful to the user or the implementor.  (And I really find
it in bad taste to involve assignment in the definition of something
like letrec.)

By adopting the proposed extension to internal defines (and loosing
the one-to-one correspondence with letrec) it would become more
attractive to clean up letrec (by only allowing letrec's of lambdas).

Anyway, I agree with you that the other solution is to make toplevel
defines closer to internal defines.  I think this is hard to do,
especially if you want "interactive defines" to be compatible with all
of this.

Marc