Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeff Barnett Newsgroups: comp.lang.lisp Subject: Re: History of lexical scope in Lisp Date: Sun, 17 Mar 2024 16:42:34 -0600 Organization: A noiseless patient Spider Lines: 44 Message-ID: References: <874jd7z5nf.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 17 Mar 2024 22:42:37 -0000 (UTC) Injection-Info: dont-email.me; posting-host="7253f92624daadea9204047ea55daaae"; logging-data="3972256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GJNma7cocr6H6AdX0JUoYUQIyu+Z1ISE=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:LzzEFgFDFBf7wr/BZY5cmN++fgU= In-Reply-To: Content-Language: en-US Bytes: 3606 On 3/16/2024 11:37 PM, Lawrence D'Oliveiro wrote: > On Sat, 16 Mar 2024 23:13:20 -0600, Jeff Barnett wrote: > >> However if your point is that you can build "simulations" of one sort of >> scoping out of primitives for another sort ... > > No, my point was that there seems to be no need for dynamic scoping, if > the only excuse anyone can come up for needing it comes out of exception > handling. That wasn't the only thing mentioned. In fact it was said to be quite useful and desired without enumeration of reasons. You of course chopped many original messages above to remove some of those "short glowing reviews" then got on your hobby horse and started to ride. Just think of the following when specifying a variable's intent: is it supposed to influence an evaluation or is it supposed to influence an evaluation when it's in a particular lexical scope? Does that help you any? The example of error handling is that it's generally supposed to control an evaluation. If error handling was lexically based then you would need to decide what to do when evaluate(x) occurs and the handling of certain conditions are specified in a scope not available when x was defined. There are choices and lots of them. When dynamic and lexical flow trees are different, you must decide by language rules or provide primitives to users that allows them to sort out intent. If you don't have any "special" variables around, you'll find that rather difficult. Lexical-only is nice and neat for many applications and philosophies of programming. But not all by a long shot. If that approach satisfies you, I'd suggest ALGOL or even SIMULA. Alan Perlis even saw uses for dynamic visibility (private communications) and discussed the thought that OWN variables did not satisfy those uses. There was an ambiguity in the second ALGOL spec on the requirements for OWN variables: if the spec was read one way, a particular function computed a Legendre polynomial; read the other way, it computed a Bessel function! (It's been a long time and I don't remember the exact pair of function families that were confounded.) In any event, the issue had to do for the rules about when an OWN needed to be bound and it was possible to have multiple bindings simultaneously! I believe this latter fact was tied up with trying to allow OWNS to act more like SPECIAL. -- Jeff Barnett