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

top-level vs internal DEFINE's



What is the reason for Scheme's handling DEFINE differently at top level and
non-top-level??  According to R3RS, they are specifically different things:
top level DEFINEs are equivalent to SET! (with a binding if needed) and
internal DEFINEs are local to the body they're in.

I have a few objections to this:

	(1) Internal DEFINE's add no power to the language: according to
	    R3RS "A <body> containing internal definitions can always be
	    converted to a completely equivalent LETREC expression."

	(2) It is very useful to be able to DEFINE global functions that
	    are within the scope of a LET (or another function I suppose).

	(3) It makes the semantics of the DEFINE expression vary by its
	    position in the code, which seems inherently wrong.

I'm sure this has been discussed before and there must be reasons for the
decision made in R3RS.  What are the advantages of the R3RS decision??

If people send me mail I'll summarize to the net.  That may keep down
redundant messages.


Bruce Krulwich