Path: utzoo!attcan!uunet!mcvax!cernvax!ethz!mrys From: mrys@ethz.UUCP (Michael Rys) Newsgroups: comp.lang.lisp Subject: What's the value of lexical scoping? Keywords: Scope, Binding, Locals, Break, Future of LISP, APL Message-ID: <512@ethz.UUCP> Date: 16 Jul 88 17:17:30 GMT References: <24508@ucbvax.BERKELEY.EDU> <515@dcl-csvax.comp.lancs.ac.uk> <452@aiva.ed.ac.uk> <519@dcl-csvax.comp.lancs.ac.uk> <478@aiva.ed.ac.uk> Reply-To: mrys@bernina.UUCP (Michael Rys) Organization: ETH Zuerich, Switzerland Lines: 29 In article <478@aiva.ed.ac.uk> jeff@uk.ac.ed.aiva (Jeff Dalton) writes: >In article <519@dcl-csvax.comp.lancs.ac.uk> simon@comp.lancs.ac.uk (Simon Brooke) writes: >>Things are bubbling! good. Let's look at some of the arguments that have >>been advanced. Firstly, the objection to dynamic binding that's most >>commonly advanced: namely, that you fall down holes when you confuse >>locals with globals. [...] If, in a lexically scoped lisp, you refer >>to a global variable thinking it's a local, or vice-versa, you'll still >>fall down a hole. Lexical scoping does not obviate the need for good >>software engineering practice - namely, in this case a *naming scheme*. > >There are many cases where both lexical and dynamic binding produce >the same result. If you stick to these cases, problems with dynamic >binding will, of course, not appear. > >... >A naming scheme can handle this problem, but bugs are much harder In APL there exists only a dynamic scoping. A possible way to get the same result as with static scoping (aka lexical scoping) is to introduce 3 new scope classes. For a detailed description see the paper of Seeds, Arpin and LaBarre in an APL Quote Quad 1978, or my paper 'Scope and access classes in APL' in the APL88 Conference Proceedings (avail. at ACM). Of course this new scheme would cause new ideas for the symbol table... Michael Rys IPSANet : mrys@ipsaint UUCP : mrys@ethz.uucp