Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!topaz!ll-xn!mit-amt!mit-eddie!psi From: psi@mit-eddie.MIT.EDU (Joseph J. Mankoski) Newsgroups: net.lang.lisp Subject: Re: Abusing "define" in Scheme... (car crashes?) Message-ID: <2048@mit-eddie.MIT.EDU> Date: Wed, 21-May-86 05:57:47 EDT Article-I.D.: mit-eddi.2048 Posted: Wed May 21 05:57:47 1986 Date-Received: Sat, 24-May-86 02:38:09 EDT References: <13508@ucla-cs.ARPA> Distribution: net Organization: Massachusetts Institute of Technology Lines: 45 Keywords: Scheme Summary: Scheme Allows Redefinitions, or You're Responsible for Your Own Car. 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? I do not know off hand of any prohibition on redefining any identifiers in Scheme. Not having a manual on hand, I resorted to testing the readily accessible Scheme implementaions here at MIT. On both the VAX and PDP-10 versions of Scheme, I was allowed to do the following: ==> (define car 8) CAR ==> car 8 ==> (car '(foo baz bar)) ERROR: Inapplicable procedure object ...*mumble*... (The last should be expected, due to the fact that identifiers only have one value in Scheme.) I see nothing inherently wrong in letting the user redefine whatever he wants in the Scheme environment. This is in keeping with the Lisp(hacker) philosophy that one should be able to frob the system at will, just as long as you are willing to do it responsibly enough that you don't hose yourself. I have seen Scheme programs written by first-time programmers which redefined T to be some random thing. Having learned (true) Lisp before Scheme, I was first horrified when I saw them doing this. There is no problem with redefining T, however, as the actual value of Truth is kept elsewhere(#!true), and final cond-clauses are often written with Else in the place of T. Whether or not such redefinions should be allowed is a matter of personal taste, though prohibiting some redefitions detracts from the uniformity of the language. Personally, I prefer the freedom to redefine anything, though I still avoid redefining T, Lambda, and of course, Define. Lisp is True Beauty, Joseph J. Mankoski ***PSI*** ...!mit-eddie!psi(UUCP) psi@ai.ai.mit.edu(ARPA)