Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!yale!Krulwich-Bruce From: Krulwich-Bruce@cs.yale.edu (Bruce Krulwich) Newsgroups: comp.lang.scheme Subject: Re: semantics of DEFINE (why use it at all on the top level?) Message-ID: <59923@yale-celray.yale.UUCP> Date: 9 May 89 01:51:12 GMT References: <890503-103409-9762@Xerox> <2454@ski.cs.vu.nl> <59918@yale-celray.yale.UUCP> Sender: root@yale.UUCP Reply-To: Krulwich-Bruce@cs.yale.edu (Bruce Krulwich) Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Lines: 38 In-reply-to: Krulwich-Bruce@cs.yale.edu (Bruce Krulwich) In article <59918@yale-celray.yale.UUCP>, I wrote: >In article <2454@ski.cs.vu.nl>, biep@cs (J A Biep Durieux) writes: >>In article <890503-103409-9762@Xerox> Pavel.pa@XEROX.COM writes: >> >>>-- A program is a mixed sequence of definitions and expressions. >>> >>>--The meaning of a program P is the same as that of the expression: >>> ((lambda (I*) P') ...) >... >>Then why not actually do this? >> >>-- The scheme top-level environment has each variable bound to a unique >> location. Many of these locations will be assigned the value >> #\undefined. >> >>-- The user can assign other values to variable locations using "set!". >> A "define" on top level will be an error, since the variable is >> already bound on that level. > >First, the system has to know what symbols to bind in the global LET >contour. It would be consistant to have DEFINE always specify that a >symbol be included in this binding. > >Secondly, having internal DEFINEs do local definitions is even more >redundant, since it is 100% translatable into a LETREC while DEFINE is >needed to specify what variables should be bound. Gee that last paragraph reads like gibberish. What I meant was: Secondly, having internal DEFINEs do local definitions is even more reduntant since this is 100% translatable into LETREC. On the other hand, top-level DEFINEs are not 100% translatable since some specification is needed of which variables should be in the top-level contour. Bruce