Path: utzoo!attcan!uunet!mcvax!ukc!etive!aiva!jeff From: jeff@aiva.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.lisp Subject: Re: What's the value of lexical scoping? Message-ID: <481@aiva.ed.ac.uk> Date: 4 Jul 88 20:04:53 GMT References: <24508@ucbvax.BERKELEY.EDU> <515@dcl-csvax.comp.lancs.ac.uk> <199@esosun.UUCP> <525@dcl-csvax.comp.lancs.ac.uk> Reply-To: jeff@uk.ac.ed.aiva (Jeff Dalton) Organization: Dept. of AI, Univ. of Edinburgh, UK Lines: 41 In article <525@dcl-csvax.comp.lancs.ac.uk> simon@comp.lancs.ac.uk (Simon Brooke) writes: >If you wish to gain information from your environment, then clearly, the >names of the symbols you use do matter. If you bind your locals either >in an arg list or in a let statement, then they don't matter. But if the Lisp provides only dynamic scope, the names of variables bound in arg lists and LETs do matter even though you often don't want them to. ] NLAMBDA -- cannot be made efficient (unless you consider a run-time call ] to EVAL efficient) >No, I agree that it cannot. I use LISP for it's expressiveness, not its >efficiency; and while I appreciate that generally you can do with a macro >all that you can do with an NLAMBDA, few people can read a macro of more >than moderate complexity. You can easily write NLAMBDAs in Common Lisp by using a function together with a macro that adds quotes to the arguments. Whether is is desirable to do so is another matter. The problems are not just of efficiency but also of understanding. ] SETF -- I can't believe my eyes... This is one of the BEST things about ] CL... I don't know what to say. Anyone who has actually USED CL with setf ] for a while knows what I'm talking about. >So you actually like overwriting cons cells without knowing what else is >pointing to them !? Either you aren't serious, or you haven't looked at >what SETF does. We all *know* REPLACs are dangerous; we all use them with >care (I hope). But SETF allows us to overwrite a cons cell without even >getting hold of it to identify it first! That is *terrifying*! and you are >going to put that horror into the hands of the innocent? SETF of CAR and REPLACA are the same thing as far as what you've said is concerned. You have not given a reason why SETF is more terrifying than REPLAC, for it does not let you modify cons cells without getting hold of them first any more than REPLAC does. Jeff Dalton, JANET: J.Dalton@uk.ac.ed AI Applications Institute, ARPA: J.Dalton%uk.ac.ed@nss.cs.ucl.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!J.Dalton