Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!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: <59918@yale-celray.yale.UUCP> Date: 9 May 89 00:41:32 GMT References: <890503-103409-9762@Xerox> <2454@ski.cs.vu.nl> Sender: root@yale.UUCP Reply-To: Krulwich-Bruce@cs.yale.edu (Bruce Krulwich) Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Lines: 30 In-reply-to: biep@cs.vu.nl (J A Biep Durieux) 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. Bruce Krulwich