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

semantics of DEFINE

   Date: 30 Apr 89 20:39:25 GMT
   From: Krulwich-Bruce@yale-zoo.arpa  (Bruce Krulwich)

   A while ago I posted the suggestion that non-top-level DEFINEs do
   the same thing as top-level DEFINEs, ie, side effect the top level.
   ... This interpretation is the one adopted by the current version
   of T (although it's not an explicit decision on the part of the T
   designers) and I believe is the interpretation used by most LISP
   dialects.  ...

   Most of the responses that I got said either like "well, Abelson
   and Sussman used the 'local' interpretation, so we really should
   stick to it" or "well, local non-top-level DEFINEs add fewer
   parentheses than nesting LETRECs."  Does anyone have other
   (theoretical or functional) reasons for this decision??

It *was* an explicit decision on the part of the designers, made in
1981.  It was an attempt to have something similar to the MIT Scheme
define but without coupling it to the syntax or semantics of lambda.
We never properly implemented the feature (LOCALE, for those of you
who have seen the T manual) that would have made it coherent, however.
Personally, I now would like to see T changed either to implement R3RS
define or to allow defines only at "top level" (given a suitable
non-global definition of "top level").

I would prefer to see the desired functionality achieved not by a
mechanism like T's but by either (a) a new construct implemented as a
macro or (b) some kind of module system.  I think a number of people
are working on this design problem now.