Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!seismo!lll-crg!lll-lcc!vecpyr!amd!pesnta!hplabs!tektronix!tekcrl!tekchips!willc From: willc@tekchips.UUCP (Will Clinger) Newsgroups: net.lang.lisp Subject: Re: Abusing "define" in Scheme... (car crashes?) Message-ID: <315@tekchips.UUCP> Date: Mon, 19-May-86 14:27:18 EDT Article-I.D.: tekchips.315 Posted: Mon May 19 14:27:18 1986 Date-Received: Sat, 24-May-86 02:22:42 EDT References: <13508@ucla-cs.ARPA> Reply-To: willc@tekchips.UUCP (Will Clinger) Distribution: net Organization: Tektronix, Inc., Beaverton, OR. Lines: 34 Keywords: Scheme In article <13508@ucla-cs.ARPA> hydar@ucla-cs.ARPA (Dan Hydar) writes: > > > Does anyone know if Scheme is defined such that ANY binding can be > changed or is there some set of functions/identifiers that can be (or > MUST be) prevented from being re-defined? > Certainly any identifier that is not the keyword of a special form can be *bound* as in (LET ((CAR 5) (CDR LOG)) (CDR CAR)); the question is whether all variables can be *assigned*. By my reading of the idealized semantics of Scheme, the answer is yes. Some implementations of Scheme, however, prevent you from assigning a new value to variables like CAR; though deliberate, I consider this behavior to be a (tolerable) bug introduced in exchange for simpler open-coding of important operations. > For instance --- are you able to do blatantly stupid things like: > > (define car 5) > An implementation of Scheme that lets you do this should be civil enough not to crash when you do it. (The system code should have been compiled in a different environment from the one in which you are wreaking your havoc. I confess, however, that MacScheme isn't entirely bulletproof in this regard.) Compare this to the status quo in other languages, where assignments such as (SETF (SYMBOL-FUNCTION 'CDR) #'LOG) may be permitted but ineffective, or have effect only when #'CAR appears in an argument position, or have effect only in code that is interpreted or code that is compiled following the assignment. Peace, William Clinger Tektronix Computer Research Laboratory willc%tekchips@tektronix