Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <433-929-6894@kylheku.com> Newsgroups: comp.lang.lisp Subject: Re: History of lexical scope in Lisp Date: Fri, 15 Mar 2024 23:04:59 -0000 (UTC) Organization: A noiseless patient Spider Lines: 35 Message-ID: <20240315155740.155@kylheku.com> References: <874jd7z5nf.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 15 Mar 2024 23:04:59 -0000 (UTC) Injection-Info: dont-email.me; posting-host="1a42fc917c3606d23239d5314488ebcf"; logging-data="2649497"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9bcDRShnGDIUMWX0le2OVzoDwVZ56uBU=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:Pj+HBYQbU2ARYJjlutb9cyAUEW8= Bytes: 2668 On 2024-03-15, Lawrence D'Oliveiro wrote: > On Fri, 15 Mar 2024 16:05:37 -0600, Jeff Barnett wrote: > >> Once you have had the programming convenience of using dynamic scope, >> you would miss it terribly in a lexical-only language, or worse, in >> something like the old FORTRAN assembler-level scope. Another argument >> that I have not seen debated but may be significant is that the CL Error >> System -- the programming primitives and error class structures don't >> make a lot of sense in lexical only. The error mechanisms like catch >> have meanings that include phrases such as "while executing this. I'm >> available to handle that". > > Lexical binding has always been understood to apply to references to > definitions of identifiers. Exception handlers are dynamically-installed > (lexical-based exception handling doesn’t make any sense), nevertheless > the names of the defined exceptions being handled are still lexically- > bound. > > This is how it works in every rationally-designed language. Names of exceptions (conditions) are not lexically bound in Common Lisp. They are pervasive, similarly to class names. Lexically scoped exception handling does make sense, during those sections of the handling when a lexical scope isn't being abandoned. If the termination point of an exception is in lexical scope of the origin, then the case can be made for handling the entire episode lexically, including the unwinding. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca