Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!biep From: biep@cs.vu.nl (J A Biep Durieux) Newsgroups: comp.lang.scheme Subject: Re: semantics of DEFINE (why use it at all on the top level?) Message-ID: <2454@ski.cs.vu.nl> Date: 8 May 89 10:21:47 GMT References: <890503-103409-9762@Xerox> Reply-To: biep@cs.vu.nl (J A Biep Durieux) Organization: VU Informatica, Amsterdam Lines: 27 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 following expression: > ((lambda (I*) P') ...) >where I* is the set of variables defined in P (i.e., appearing as the CADR >of a DEFINE form), P' is the sequence of expressions obtained by replacing >each definition in P with the corresponding assignment, and is >an expression producing some useless value. 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. -- Allow the syntax "(set! (first cell) (car cell))" to mean the analogue of the comparable "define" syntax -- Biep. (biep@cs.vu.nl via mcvax) Who am I to doubt the existence of God? I am only a simple man, I already have trouble enough doubting the existence of my neighbour!