Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Be *excellent* to each other." -- Bill, or Ted, in Bill and Ted's Excellent Adventure


devel / comp.lang.lisp / Is Lexical Binding The Norm Yet?

SubjectAuthor
* Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
+- Re: Is Lexical Binding The Norm Yet?Jeff Barnett
+* Re: Is Lexical Binding The Norm Yet?Alan Bawden
|`* Re: Is Lexical Binding The Norm Yet?Paul Rubin
| +- Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
| +* Re: Is Lexical Binding The Norm Yet?Alan Bawden
| |+* Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
| ||`* Re: Is Lexical Binding The Norm Yet?Stefan Ram
| || `- Re: Is Lexical Binding The Norm Yet?Alan Bawden
| |`* Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
| | `* Re: Is Lexical Binding The Norm Yet?Alan Bawden
| |  +- Re: Is Lexical Binding The Norm Yet?Stefan Ram
| |  `* Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
| |   `- Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
| `* Re: Is Lexical Binding The Norm Yet?Jeff Barnett
|  +* Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
|  |`- Re: Is Lexical Binding The Norm Yet?Jeff Barnett
|  `* Re: Is Lexical Binding The Norm Yet?Stefan Monnier
|   +* Re: Is Lexical Binding The Norm Yet?Jeff Barnett
|   |`* Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
|   | +* Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
|   | |+- Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
|   | |`* Re: Is Lexical Binding The Norm Yet?George Neuner
|   | | `* Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
|   | |  +* Re: Is Lexical Binding The Norm Yet?George Neuner
|   | |  |`* Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
|   | |  | `* Re: Is Lexical Binding The Norm Yet?George Neuner
|   | |  |  `* Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
|   | |  |   +- Re: Is Lexical Binding The Norm Yet?George Neuner
|   | |  |   +* Re: Is Lexical Binding The Norm Yet?Alan Bawden
|   | |  |   |+- Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
|   | |  |   |+- Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
|   | |  |   |`* Re: Is Lexical Binding The Norm Yet?Stefan Ram
|   | |  |   | `* Re: Is Lexical Binding The Norm Yet?Stefan Ram
|   | |  |   |  +- Re: Is Lexical Binding The Norm Yet?Stefan Ram
|   | |  |   |  `* Re: Is Lexical Binding The Norm Yet?Alan Bawden
|   | |  |   |   `- Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
|   | |  |   `- Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
|   | |  `* Re: Is Lexical Binding The Norm Yet?Stefan Ram
|   | |   `* Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
|   | |    `- Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
|   | `* Re: Is Lexical Binding The Norm Yet?Lars Brinkhoff
|   |  `- Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
|   `- Re: Is Lexical Binding The Norm Yet?Lawrence D'Oliveiro
`* Re: Is Lexical Binding The Norm Yet?Kaz Kylheku
 `- Dynamic scope and parameter objects (was: Is Lexical Binding The Norm Yet?)Stefan Monnier

Pages:12
Is Lexical Binding The Norm Yet?

<uo1i8c$jbru$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17815&group=comp.lang.lisp#17815

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Is Lexical Binding The Norm Yet?
Date: Sun, 14 Jan 2024 21:04:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <uo1i8c$jbru$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 14 Jan 2024 21:04:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5cf5a003a05059306218191ac330ad5f";
logging-data="634750"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IHB5Adfhz0u5Ur0Us/yNF"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:huz0ZsXWS8ZFiICA/j9AtVcjvfg=
 by: Lawrence D'Oliv - Sun, 14 Jan 2024 21:04 UTC

That example I posted elsewhere (a function returning a function) relies
on lexical binding in order to work properly.

Is lexical binding accepted as a standard part of Common Lisp yet? I know
it was built in from the start in Scheme. But some in the older Lisp
community still seem to think dynamic binding is useful.

Re: Is Lexical Binding The Norm Yet?

<uo1ip8$jdi3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17816&group=comp.lang.lisp#17816

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Sun, 14 Jan 2024 14:13:13 -0700
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <uo1ip8$jdi3$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 14 Jan 2024 21:13:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4a1129a4f61997a41ec0d3fd64f8a55b";
logging-data="636483"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jYriwFyiRy4H3NuoagwnYrhUnJXquUrk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:WKXpSCMNnCfbJKDlaANsLdGGQHA=
Content-Language: en-US
In-Reply-To: <uo1i8c$jbru$2@dont-email.me>
 by: Jeff Barnett - Sun, 14 Jan 2024 21:13 UTC

On 1/14/2024 2:04 PM, Lawrence D'Oliveiro wrote:
> That example I posted elsewhere (a function returning a function) relies
> on lexical binding in order to work properly.
>
> Is lexical binding accepted as a standard part of Common Lisp yet? I know
> it was built in from the start in Scheme. But some in the older Lisp
> community still seem to think dynamic binding is useful.

If by "Common Lisp" you mean the language that we all think you are
talking about then lexical binding is very much apart of it and the
default. That does not change the fact that dynamic (or special)
bindings are very useful. That is why Common Lisp offers both. Having
both is one of the really really good features of the language.
--
Jeff Barnett

Re: Is Lexical Binding The Norm Yet?

<86r0ijsdyj.fsf@williamsburg.bawden.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17817&group=comp.lang.lisp#17817

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.furie.org.uk!nntp.terraraq.uk!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Sun, 14 Jan 2024 18:16:36 -0500
Organization: ITS Preservation Society
Lines: 18
Message-ID: <86r0ijsdyj.fsf@williamsburg.bawden.org>
References: <uo1i8c$jbru$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: bawden.eternal-september.org; posting-host="3f5585a23f7a973f1f644762bb7837bf";
logging-data="672575"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/wzwQJQ74MaThZ01YMYHb"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:fIq+xDigwAh8CwfNYFw48AaDBgE=
sha1:lykT+ASnyaOJgfItVC1iCUKLt9Q=
 by: Alan Bawden - Sun, 14 Jan 2024 23:16 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

Is lexical binding accepted as a standard part of Common Lisp yet?

Lexical binding has been the default behavior of Common Lisp from its
very beginning.

In the early history of LISP there was some experimentation with other
behaviors. But by the late 70s, well before Common Lisp was even
conceived, everybody was convinced that lexical binding was the way to
go. So your use of the word "yet" is hilarious.

I will never understand now these myths perpetuate. There are still
people who think that Lisp is always interpreted, despite the fact that
we've been compiling to machine code since the days of LISP 1.5 in
around 1960!

- Alan

Re: Is Lexical Binding The Norm Yet?

<20240114170708.625@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17818&group=comp.lang.lisp#17818

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Mon, 15 Jan 2024 01:16:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <20240114170708.625@kylheku.com>
References: <uo1i8c$jbru$2@dont-email.me>
Injection-Date: Mon, 15 Jan 2024 01:16:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e6e416ab9777932f1864a45df11970fb";
logging-data="694513"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18edSgDum8lbeJtRHVJuTVfqzUQmT4RMDI="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:/JuvQ8bEe3mBn8v+Aa1Jv4Iwvp4=
 by: Kaz Kylheku - Mon, 15 Jan 2024 01:16 UTC

On 2024-01-14, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> That example I posted elsewhere (a function returning a function) relies
> on lexical binding in order to work properly.
>
> Is lexical binding accepted as a standard part of Common Lisp yet?

Common Lisp standardization concluded in 1994 and has not reconvened.

Lexical binding for variables was standardized as the default mode.

Dynamic binding is requested in several ways:

- if the symbol is marked for dynamic binding, that is used.

- declare can be used to request dynamic binding for symbols
not marked for dynamic binding.

Symbols that are the target of a defvar or defparameter form become
marked for dynamic binding. Most of the time, that is the preferred
way to introduce a dynamic variable: to define it globally via a
top-level defvar or defparameter form and make sure that is processed
before any code that locally bind it. Make sure your compiler
sees your (defvar *foo*) before it sees any (let ((*foo* ...)) ...)
expression, otherwise it will wrongly compile that as lexical
binding.

> I know
> it was built in from the start in Scheme. But some in the older Lisp
> community still seem to think dynamic binding is useful.

It is seen as useful in the Scheme community, where it gets reinvented
as fluid-let (SRFI 15) or the really bizarre concoction of "parameter
objects" (SRFI 39).

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: Is Lexical Binding The Norm Yet?

<871qajgr9k.fsf@nightsong.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17820&group=comp.lang.lisp#17820

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Sun, 14 Jan 2024 20:22:15 -0800
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <871qajgr9k.fsf@nightsong.com>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ad2ac75a0fc0fa4aa97911757091ccfa";
logging-data="863565"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+L9E1uI/yBMnN8rJq6QdL"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:/fA5abXJnzuMnj/gRL81LJNiQD4=
sha1:qPKGkuq9yLza+l88wLNeO1mYos4=
 by: Paul Rubin - Mon, 15 Jan 2024 04:22 UTC

Alan Bawden <alan@csail.mit.edu> writes:
> I will never understand now these myths perpetuate.

Maybe people confuse Common Lisp with Emacs Lisp, which was historically
purely dynamically scoped. I don't know if it is still that way, not
counting Guile Emacs. I never used Maclisp or Lisp 1.5 so I don't know
how their scoping worked. But dynamic scope is convenient for
simple-minded implementations.

Now you have me wondering about the scoping rules of Church's lambda
calculus, or if the concept even applies. At first impression it seems
lexical.

Re: Is Lexical Binding The Norm Yet?

<uo2dc3$qgkt$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17821&group=comp.lang.lisp#17821

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Mon, 15 Jan 2024 04:47:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <uo2dc3$qgkt$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 15 Jan 2024 04:47:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="48e770db85e070ae7e9ec8feca197cc8";
logging-data="869021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189AiTQJ0PIrAVw1uvEajvx"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:I1ABhpnyRcJUVWafH9jDkMEspJQ=
 by: Lawrence D'Oliv - Mon, 15 Jan 2024 04:47 UTC

On Sun, 14 Jan 2024 20:22:15 -0800, Paul Rubin wrote:

> Now you have me wondering about the scoping rules of Church's lambda
> calculus, or if the concept even applies. At first impression it seems
> lexical.

It wouldn’t have worked otherwise.

Re: Is Lexical Binding The Norm Yet?

<86mst7rr53.fsf@williamsburg.bawden.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17822&group=comp.lang.lisp#17822

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Mon, 15 Jan 2024 02:29:28 -0500
Organization: ITS Preservation Society
Lines: 29
Message-ID: <86mst7rr53.fsf@williamsburg.bawden.org>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org>
<871qajgr9k.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: bawden.eternal-september.org; posting-host="3f5585a23f7a973f1f644762bb7837bf";
logging-data="902902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18rRYPbuIgasfv1zUu3A8sC"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:OCqKna7qPZlrjucd4SRYu+gGVxA=
sha1:MNfHiyvNk9m2yWKiMpQQkyGxswk=
 by: Alan Bawden - Mon, 15 Jan 2024 07:29 UTC

Paul Rubin <no.email@nospam.invalid> writes:

... I never used Maclisp or Lisp 1.5 so I don't know how their
scoping worked.

MacLisp was weird. You typically debugged your program using the
MacLisp interpreter because it made the debugging cycle faster, and the
interpreter was purely dynamicly scoped. But when the MacLisp compiler
compiled your code, all the variables you hadn't declared SPECIAL became
lexical! I know that sounds crazy, but because MacLisp didn't really
support closures, it wasn't too hard to write code in a style such that
it didn't really matter whether variables were dynamic or lexical.

Assuming that the interpreter in the appendix of the Lisp 1.5 manual, I
would say that Lisp 1.5 was lexical. But I'm not 100% certain that that
interpreter really reflects the system's true semantics. (Does the
source code for the Lisp 1.5 system still exist anywhere?)

Now you have me wondering about the scoping rules of Church's lambda
calculus, or if the concept even applies. At first impression it seems
lexical.

It's definitely lexical, but you are right to wonder if the distinction
even applies. Our notion of "dynamic" scoping seems pretty closely tied
to the workings of the typical applicative order Lisp evaluator. I
imagine Church himself would be pretty puzzled by our notion of dynamic
scoping...

- Alan

Re: Is Lexical Binding The Norm Yet?

<uo2q5l$ruc8$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17823&group=comp.lang.lisp#17823

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Mon, 15 Jan 2024 08:25:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uo2q5l$ruc8$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<86mst7rr53.fsf@williamsburg.bawden.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 15 Jan 2024 08:25:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="48e770db85e070ae7e9ec8feca197cc8";
logging-data="915848"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//FDOcPppStziaJyQAdtOr"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Si2W3hma2Gm51s2prBf6EQri7Ak=
 by: Lawrence D'Oliv - Mon, 15 Jan 2024 08:25 UTC

On Mon, 15 Jan 2024 02:29:28 -0500, Alan Bawden wrote:

> Assuming that the interpreter in the appendix of the Lisp 1.5 manual, I
> would say that Lisp 1.5 was lexical.

I recall in McCarthy’s memoir of the origins of Lisp, he thought the
scoping issue (the “FUNARG problem”, I think he called it) was a simple
coding bug, and got one of his grad students to fix it.

Re: Is Lexical Binding The Norm Yet?

<funarg-20240115104452@ram.dialup.fu-berlin.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17824&group=comp.lang.lisp#17824

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!paganini.bofh.team!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: 15 Jan 2024 09:46:46 GMT
Organization: Stefan Ram
Lines: 21
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <funarg-20240115104452@ram.dialup.fu-berlin.de>
References: <uo1i8c$jbru$2@dont-email.me> <86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com> <86mst7rr53.fsf@williamsburg.bawden.org> <uo2q5l$ruc8$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de jzqtWE0OU2tuK76p9yQAPwB9UiYcKxeMG0SbogidBax+iS
Cancel-Lock: sha1:td2abu9LjgzwBYuvQxYesLpQ0wc= sha256:vEb+d1X5h8KMmJqvaRROXGlhyw/YoVrm0e0E4mnlMos=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Mon, 15 Jan 2024 09:46 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>I recall in McCarthy’s memoir of the origins of Lisp, he thought the
>scoping issue (the “FUNARG problem”, I think he called it) was a simple
>coding bug, and got one of his grad students to fix it.

Stoyan wrote:

|McCarthy admits that he underestimated the problem. "I must
|confess that I regarded this difficulty as just a bug and
|expressed confidence that Steve Russell would soon fix it..."

. Stoyan commented:

|The funarg event proves that McCarthy was now far from his
|LISP. He won the theoretical battle und searched for the next
|field. The mathematical theory of computation, time sharing,
|and proof checking were his new interests. LISP lost first
|priority.

.

Re: Is Lexical Binding The Norm Yet?

<20240115100831.967@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17827&group=comp.lang.lisp#17827

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Mon, 15 Jan 2024 18:31:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 107
Message-ID: <20240115100831.967@kylheku.com>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<86mst7rr53.fsf@williamsburg.bawden.org>
Injection-Date: Mon, 15 Jan 2024 18:31:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e6e416ab9777932f1864a45df11970fb";
logging-data="1096849"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18c+QnrgoBiODbN7oMNWlGrcZoCSlfCgNc="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:TenGuYfFBs4Uuk8k05Se6noXxbQ=
 by: Kaz Kylheku - Mon, 15 Jan 2024 18:31 UTC

On 2024-01-15, Alan Bawden <alan@csail.mit.edu> wrote:
> Paul Rubin <no.email@nospam.invalid> writes:
>
> ... I never used Maclisp or Lisp 1.5 so I don't know how their
> scoping worked.
>
> MacLisp was weird. You typically debugged your program using the
> MacLisp interpreter because it made the debugging cycle faster, and the
> interpreter was purely dynamicly scoped. But when the MacLisp compiler
> compiled your code, all the variables you hadn't declared SPECIAL became
> lexical! I know that sounds crazy, but because MacLisp didn't really
> support closures, it wasn't too hard to write code in a style such that
> it didn't really matter whether variables were dynamic or lexical.
>
> Assuming that the interpreter in the appendix of the Lisp 1.5 manual, I
> would say that Lisp 1.5 was lexical. But I'm not 100% certain that that
> interpreter really reflects the system's true semantics. (Does the
> source code for the Lisp 1.5 system still exist anywhere?)
>
> Now you have me wondering about the scoping rules of Church's lambda
> calculus, or if the concept even applies. At first impression it seems
> lexical.
>
> It's definitely lexical, but you are right to wonder if the distinction
> even applies. Our notion of "dynamic" scoping seems pretty closely tied
> to the workings of the typical applicative order Lisp evaluator. I
> imagine Church himself would be pretty puzzled by our notion of dynamic
> scoping...

Even though LC is lexical, I suspect that examples of LC that break
under dynamic scope have to be either incorrect, or convoluted.

What I'm referring to by "incorrect" is the presence of unbound
references. Some function (lambda (x) y) occurs where y is not
bound to anything, and that is then passed and called somewhere where y
is dynamically bound. This "breaks" in the sense that it's ill
formed under normal LC, but dynamic LC accepts it.

The other cases deal with references to the wrong parameter.

Wrong references happen in two ways:

- the same identifier is reused for two different purposes, which
"cross wires" due to the scoping.

- the same variable is activated multiple times, which are expected
to be different instances but aren't.

The first instance is easier to first show with bound functions,
like:

(define fun (x) (x x))

(lambda (x)
(fun (lambda (y) x)))

Where inside fun, the x references are to its own parameter,
so the (lambda (y) x) gets confused. We can get rid of the define:

(lambda (x)
((lambda (x) (x x)) (lambda (y) x)))

OK, but when we do this, this becomes confusing regardless of
the scoping discipline, due to the reuse of the parameter name!
All the variables in the example are singly instantiated, so
the only problem is the naming; if we make it:

(lambda (z)
((lambda (x) (x x)) (lambda (y) z)))

the problem goes away and it now means the same thing under
dynamic scope.

The remaining category is problems where the LC breaks because a the
same variable is instantiated multiple times, and those instantiations
are not separately being captured by a lambda, since there is
actually only one variable.

In Lisp, it's easy to come up with examples: such as the difference
between a loop construct which steps the dummy variable versus one
which freshly binds it.

People are running into this even in Blub languages. E.g. Go language
recently fixed it foreach-type looping construct to bind a fresh
variable, under the belief that this is what programmers expect.

Under dynamic scope, it won't make a difference. You can pretend to bind
a fresh variable, but it's really equivalent to stepping, since there is
only one variable. In Common Lisp, if our implementation has a DOLIST
loop that freshly binds, but we use a special variable as the dummy,
then that is reduced to being equivalent to mutating DOLIST.

It's not obvious to me how to make a simple example of this in lambda
calculus. You don't have loops that can step a variable versus bind.
You have to use recursion in order to evaluate the same functions
multiple times, with different values of free variables that have
to be demonstrably captured.

I can see why it might not have been obvious to MacCarthy that saving
and restoring variables isn't enough for lambda-calculus-like
computation.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: Is Lexical Binding The Norm Yet?

<86il3us6ks.fsf@williamsburg.bawden.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17828&group=comp.lang.lisp#17828

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Mon, 15 Jan 2024 15:08:19 -0500
Organization: ITS Preservation Society
Lines: 12
Message-ID: <86il3us6ks.fsf@williamsburg.bawden.org>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org>
<871qajgr9k.fsf@nightsong.com>
<86mst7rr53.fsf@williamsburg.bawden.org>
<20240115100831.967@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: bawden.eternal-september.org; posting-host="3f5585a23f7a973f1f644762bb7837bf";
logging-data="1123654"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PSRG19TiysoQ85l9/RuYB"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:cj2erEM0nKeLjgYpMB8xHKHoY9U=
sha1:M0ucIfjm+1na+/+esAwiUsCTH50=
 by: Alan Bawden - Mon, 15 Jan 2024 20:08 UTC

Kaz Kylheku <433-929-6894@kylheku.com> writes:

Even though LC is lexical, I suspect that examples of LC that break
under dynamic scope have to be either incorrect, or convoluted.

I'm having trouble understanding what you wrote here because I can't
figure out for the life of me what you mean by "LC". At first I thought
you meant LC as short for Lambda Calculus, but later you start talking
about "normal LC" vs. "dynamic LC", and since I have no idea what
"dynamic lambda calculus" could be, I'm stumped.

- Alan

Re: Is Lexical Binding The Norm Yet?

<86edeis5vd.fsf@williamsburg.bawden.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17829&group=comp.lang.lisp#17829

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Mon, 15 Jan 2024 15:23:34 -0500
Organization: ITS Preservation Society
Lines: 29
Message-ID: <86edeis5vd.fsf@williamsburg.bawden.org>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org>
<871qajgr9k.fsf@nightsong.com>
<86mst7rr53.fsf@williamsburg.bawden.org> <uo2q5l$ruc8$1@dont-email.me>
<funarg-20240115104452@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: bawden.eternal-september.org; posting-host="3f5585a23f7a973f1f644762bb7837bf";
logging-data="1131513"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Xs2a9a5V/1aTC8nlQYin9"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:M4HJSq0v+1H6jn6ufkc6U4+ZM9w=
sha1:hPc8ycMdvt2Y/0zXrzZg0yoFBVU=
 by: Alan Bawden - Mon, 15 Jan 2024 20:23 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:

Stoyan wrote:

|McCarthy admits that he underestimated the problem. "I must
|confess that I regarded this difficulty as just a bug and
|expressed confidence that Steve Russell would soon fix it..."

Stoyan commented:

|The funarg event proves that McCarthy was now far from his
|LISP. He won the theoretical battle und searched for the next
|field. The mathematical theory of computation, time sharing,
|and proof checking were his new interests. LISP lost first
|priority.

It's always important to keep in mind that McCarthy didn't add LAMBDA to
Lisp because he was trying to build a programming language based on
Lambda Calculus. What he _was_ trying to do was build a programming
language based on first order predicate calculus. He introduced LAMBDA
because he needed it in order to define recursive functions. I can't
find it right now, but someplace in his writings he apologized for the
fact that LAMBDA made it possible to write code that was definitely
_not_ first order, which is not something that he intended!

McCarthy was a really smart guy. So smart that some of his mistakes are
more interesting than many other smart people's best ideas.

- Alan

Re: Is Lexical Binding The Norm Yet?

<lc-20240115212653@ram.dialup.fu-berlin.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17830&group=comp.lang.lisp#17830

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: 15 Jan 2024 20:27:31 GMT
Organization: Stefan Ram
Lines: 9
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <lc-20240115212653@ram.dialup.fu-berlin.de>
References: <uo1i8c$jbru$2@dont-email.me> <86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com> <86mst7rr53.fsf@williamsburg.bawden.org> <20240115100831.967@kylheku.com> <86il3us6ks.fsf@williamsburg.bawden.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de AD9b6wPAG5V/NV941dy74gaMw4YX5I6hljXGmIjXTYRP66
Cancel-Lock: sha1:TmcSdSzVdzytdjuYreRh7tcIbb8= sha256:lE6A6C4cFnSqHv6Qt+ibtdcwE8ckcj30bjwlsL++UBI=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Mon, 15 Jan 2024 20:27 UTC

Alan Bawden <alan@csail.mit.edu> writes:
>Kaz Kylheku <433-929-6894@kylheku.com> writes:
> Even though LC is lexical, I suspect that examples of LC that break
> under dynamic scope have to be either incorrect, or convoluted.

In Usenet, I prefer to use ">" to mark quotations, not indentation.

"LC" could also be "Lisp code".

Re: Is Lexical Binding The Norm Yet?

<uo4id7$14ifr$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17831&group=comp.lang.lisp#17831

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Mon, 15 Jan 2024 17:25:08 -0700
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <uo4id7$14ifr$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 16 Jan 2024 00:25:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1949c0ca17d44b72d1a506bdf72c772d";
logging-data="1198587"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sUB+oHz8srX6ceyPOMG0YuOgj6gceOoo="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Fc/UUwXMIrxBXhCiw0C6Z0mNpgk=
Content-Language: en-US
In-Reply-To: <871qajgr9k.fsf@nightsong.com>
 by: Jeff Barnett - Tue, 16 Jan 2024 00:25 UTC

On 1/14/2024 9:22 PM, Paul Rubin wrote:
> Alan Bawden <alan@csail.mit.edu> writes:
>> I will never understand now these myths perpetuate.
>
> Maybe people confuse Common Lisp with Emacs Lisp, which was historically
> purely dynamically scoped. I don't know if it is still that way, not
> counting Guile Emacs. I never used Maclisp or Lisp 1.5 so I don't know
> how their scoping worked. But dynamic scope is convenient for
> simple-minded implementations.
>
> Now you have me wondering about the scoping rules of Church's lambda
> calculus, or if the concept even applies. At first impression it seems
> lexical.

In the old days, Lisps were LOCALLY scoped and included special
variables (dynamic scoped) too. Closures were available in some
implementations for a specified set of special variables. N.B. that by
LEXICAL scope we normally mean that nested function definitions see
local bindings where ever they are executed - not so for LOCAL binding.

Lexical bindings were desired for most of us but we neither had the
address space or memory to make effectively fast, usable
implementations. ALGOL had enough extra structure rules and no specials
so could do LEXICAL as shown by the Boroughs (sp?) Algol Machines that
existed decades before the various Lisp machines and were primary used
in the Banking business.
--
Jeff Barnett

Re: Is Lexical Binding The Norm Yet?

<uo4j51$14l7t$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17832&group=comp.lang.lisp#17832

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Tue, 16 Jan 2024 00:37:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uo4j51$14l7t$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<uo4id7$14ifr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 16 Jan 2024 00:37:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ca75c4ad8a1ef3af6a8bb895abab775c";
logging-data="1201405"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19vk1KsESWf9gjjCS5dl2JS"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:aY1oh/tXoZZR10vuE2r8UXvM8pM=
 by: Lawrence D'Oliv - Tue, 16 Jan 2024 00:37 UTC

On Mon, 15 Jan 2024 17:25:08 -0700, Jeff Barnett wrote:

> Lexical bindings were desired for most of us but we neither had the
> address space or memory to make effectively fast, usable
> implementations.

Basically, call frames (or parts of them) go on the heap. I think Python
manages some efficiency gains by only including referenced variables.

Re: Is Lexical Binding The Norm Yet?

<20240115172705.252@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17833&group=comp.lang.lisp#17833

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Tue, 16 Jan 2024 01:29:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <20240115172705.252@kylheku.com>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<86mst7rr53.fsf@williamsburg.bawden.org> <20240115100831.967@kylheku.com>
<86il3us6ks.fsf@williamsburg.bawden.org>
Injection-Date: Tue, 16 Jan 2024 01:29:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0e4d96b6e3e7b220599d4efcc49ca97f";
logging-data="1212047"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MBiTXOeF8zS3WQ/wxyTh2hhn3QRgWI/M="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:kIjuBVcxCmcInTXc7jXXJ22Yfjo=
 by: Kaz Kylheku - Tue, 16 Jan 2024 01:29 UTC

On 2024-01-15, Alan Bawden <alan@csail.mit.edu> wrote:
> Kaz Kylheku <433-929-6894@kylheku.com> writes:
>
> Even though LC is lexical, I suspect that examples of LC that break
> under dynamic scope have to be either incorrect, or convoluted.
>
> I'm having trouble understanding what you wrote here because I can't
> figure out for the life of me what you mean by "LC". At first I thought
> you meant LC as short for Lambda Calculus, but later you start talking
> about "normal LC" vs. "dynamic LC", and since I have no idea what
> "dynamic lambda calculus" could be, I'm stumped.

It has been observed that a lot of Lisp code works fine if we subsitute
dynamic binding for lexical.

So we can translate that into the lambda calculus domain. We need to
imagine a lambda calculus that has dynamic binding.

Some regular lambda calculus examples would still work. Some that don't
work could be repaired just by renaming clashing variables.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: Is Lexical Binding The Norm Yet?

<uo4nmi$156hv$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17834&group=comp.lang.lisp#17834

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Tue, 16 Jan 2024 01:55:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <uo4nmi$156hv$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<86mst7rr53.fsf@williamsburg.bawden.org> <20240115100831.967@kylheku.com>
<86il3us6ks.fsf@williamsburg.bawden.org> <20240115172705.252@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 16 Jan 2024 01:55:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ca75c4ad8a1ef3af6a8bb895abab775c";
logging-data="1219135"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+t1VE202I7N2Gik1KmSDxZ"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:s4xCdm0lFiXeYoYrtUYv8xv8+I0=
 by: Lawrence D'Oliv - Tue, 16 Jan 2024 01:55 UTC

On Tue, 16 Jan 2024 01:29:06 -0000 (UTC), Kaz Kylheku wrote:

> It has been observed that a lot of Lisp code works fine if we subsitute
> dynamic binding for lexical.

I tend to use function factories a lot. And Python allows class factories
as well. None of that would work.

Re: Is Lexical Binding The Norm Yet?

<uo6hnu$1idji$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17835&group=comp.lang.lisp#17835

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Tue, 16 Jan 2024 11:26:04 -0700
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uo6hnu$1idji$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<uo4id7$14ifr$1@dont-email.me> <uo4j51$14l7t$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 16 Jan 2024 18:26:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1949c0ca17d44b72d1a506bdf72c772d";
logging-data="1652338"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fiJq2zbsDY/fuNL5D8T2MSwhbf0Sc+74="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:TgJG3h0aPOE0Zxf5XtNZ8YklU3M=
Content-Language: en-US
In-Reply-To: <uo4j51$14l7t$1@dont-email.me>
 by: Jeff Barnett - Tue, 16 Jan 2024 18:26 UTC

On 1/15/2024 5:37 PM, Lawrence D'Oliveiro wrote:
> On Mon, 15 Jan 2024 17:25:08 -0700, Jeff Barnett wrote:
>
>> Lexical bindings were desired for most of us but we neither had the
>> address space or memory to make effectively fast, usable
>> implementations.
>
> Basically, call frames (or parts of them) go on the heap. I think Python
> manages some efficiency gains by only including referenced variables.

The optimization code itself needed to fit in small computer
environments. The early Lisp 1.5s, for the most part, were developed on
computers with a few hundred thousand bytes (in today's memory units)
with no virtually addressing and the later ones more or less followed
with compatible languages on newer hardware.

To see the effect of such memory limitations, consider the GC:
structures were folded or compacted and under the table erasure lists
were used. There wasn't enough address space or memory to do copy
collects and flips.

The technology was understood but the hardware wasn't up to it.
--
Jeff Barnett

Dynamic scope and parameter objects (was: Is Lexical Binding The Norm Yet?)

<jwvo7dk51n3.fsf-monnier+comp.lang.lisp@gnu.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17836&group=comp.lang.lisp#17836

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: monnier@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.lang.lisp
Subject: Dynamic scope and parameter objects (was: Is Lexical Binding The Norm Yet?)
Date: Tue, 16 Jan 2024 18:01:21 -0500
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <jwvo7dk51n3.fsf-monnier+comp.lang.lisp@gnu.org>
References: <uo1i8c$jbru$2@dont-email.me> <20240114170708.625@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ae4e0b2817be3321737ac72a8abc1fea";
logging-data="1744071"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19f4O1FPSKji+jxY4+ofGBOnCb6RNF8kII="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:fFRfwYhx7ef0eMlGz6DfrUo6Saw=
sha1:V7VlZvqzbugwFWM3knF8RDLzolw=
 by: Stefan Monnier - Tue, 16 Jan 2024 23:01 UTC

Kaz Kylheku [2024-01-15 01:16:10] wrote:
> It is seen as useful in the Scheme community, where it gets reinvented
> as fluid-let (SRFI 15) or the really bizarre concoction of "parameter
> objects" (SRFI 39).

Most of SRFI-39 strikes me as intuitive rather than bizarre (it's
basically plain-old dynamic scoping just using objects instead of
symbols to "name" the "variables"), but I do find the `converter` part
rather odd.

Does anyone know why that `converter` was added to SRFI 39?

I also can't see how to define something equivalent to `progv` on top of
SRFI-39.

Stefan

Re: Is Lexical Binding The Norm Yet?

<jwvedeg510z.fsf-monnier+comp.lang.lisp@gnu.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17837&group=comp.lang.lisp#17837

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: monnier@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Tue, 16 Jan 2024 18:16:02 -0500
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <jwvedeg510z.fsf-monnier+comp.lang.lisp@gnu.org>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org>
<871qajgr9k.fsf@nightsong.com> <uo4id7$14ifr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ae4e0b2817be3321737ac72a8abc1fea";
logging-data="1748399"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+R24LouVF2KSvW6USZ5tWvsXB4Q9j34qs="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:+LTwmE0xps1mFn+mnyUAIdCLvgY=
sha1:fhqUvBlijRs91OVJAV1l6nlPkl8=
 by: Stefan Monnier - Tue, 16 Jan 2024 23:16 UTC

> In the old days, Lisps were LOCALLY scoped and included special variables
> (dynamic scoped) too. Closures were available in some implementations for
> a specified set of special variables. N.B. that by LEXICAL scope we normally
> mean that nested function definitions see local bindings where ever they are
> executed - not so for LOCAL binding.

See for example the definition of "closures" in the context of
Lisp-Machine-Lisp at https://hanshuebner.github.io/lmman/fd-clo.xml#closure

Basically, they're functions that remember the value of dynbound
variables at the time that the closure was created and then rebind those
dynbound vars to those values around the evaluation of their body.

In ELisp you could implement it as follows:

(oclosure-define (lml-closure
(:predicate lml-closurep))
bindings function)

(defun lml-closure (varlist function)
"Create a \"closure\" over the dynamic variables in VARLIST."
(oclosure-lambda
(lml-closure (bindings (mapcar (lambda (v) (cons v (symbol-value v)))
varlist))
(function function))
(&rest args)
(cl-progv (mapcar #'car bindings) (mapcar #'cdr bindings)
(apply function args))))

-- Stefan

Re: Is Lexical Binding The Norm Yet?

<uo9cbb$264u2$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17848&group=comp.lang.lisp#17848

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Wed, 17 Jan 2024 13:12:26 -0700
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <uo9cbb$264u2$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<uo4id7$14ifr$1@dont-email.me>
<jwvedeg510z.fsf-monnier+comp.lang.lisp@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 17 Jan 2024 20:12:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6e67502718939b6e587259517ab9c2c7";
logging-data="2298818"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dq+2XPiMRU0Gtrk7Q6o/U5AAsFoLL5CQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:9N62wBkVrdgsRb4m+3q85o5z5+0=
Content-Language: en-US
In-Reply-To: <jwvedeg510z.fsf-monnier+comp.lang.lisp@gnu.org>
 by: Jeff Barnett - Wed, 17 Jan 2024 20:12 UTC

On 1/16/2024 4:16 PM, Stefan Monnier wrote:
>> In the old days, Lisps were LOCALLY scoped and included special variables
>> (dynamic scoped) too. Closures were available in some implementations for
>> a specified set of special variables. N.B. that by LEXICAL scope we normally
>> mean that nested function definitions see local bindings where ever they are
>> executed - not so for LOCAL binding.
>
> See for example the definition of "closures" in the context of
> Lisp-Machine-Lisp at https://hanshuebner.github.io/lmman/fd-clo.xml#closure

Note that above I was talking about Lisps that predated the Lisp Machines.

> Basically, they're functions that remember the value of dynbound
> variables at the time that the closure was created and then rebind those
> dynbound vars to those values around the evaluation of their body.

There was no "rebinding". Rather the original binding was used by all
who could see it vis a vis the scoping rules. Since multiple closures
(including the one where that binding occurred) could reference the same
lexical binding, creating multiple rebinding would screw the semantics.

> In ELisp you could implement it as follows:
>
> (oclosure-define (lml-closure
> (:predicate lml-closurep))
> bindings function)
>
> (defun lml-closure (varlist function)
> "Create a \"closure\" over the dynamic variables in VARLIST."
> (oclosure-lambda
> (lml-closure (bindings (mapcar (lambda (v) (cons v (symbol-value v)))
> varlist))
> (function function))
> (&rest args)
> (cl-progv (mapcar #'car bindings) (mapcar #'cdr bindings)
> (apply function args))))--
Jeff Barnett

Re: Is Lexical Binding The Norm Yet?

<20240117122629.806@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17849&group=comp.lang.lisp#17849

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Wed, 17 Jan 2024 20:37:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <20240117122629.806@kylheku.com>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<uo4id7$14ifr$1@dont-email.me>
<jwvedeg510z.fsf-monnier+comp.lang.lisp@gnu.org>
<uo9cbb$264u2$1@dont-email.me>
Injection-Date: Wed, 17 Jan 2024 20:37:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30353e714807d76ba68823a6307c7dd8";
logging-data="2311706"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18aulJs1bRejzv1dMOoBLbvkW5mPcrs0+E="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:lpMY85+ptwOGAWKxfnUziq9/+gM=
 by: Kaz Kylheku - Wed, 17 Jan 2024 20:37 UTC

On 2024-01-17, Jeff Barnett <jbb@notatt.com> wrote:
> On 1/16/2024 4:16 PM, Stefan Monnier wrote:
>>> In the old days, Lisps were LOCALLY scoped and included special variables
>>> (dynamic scoped) too. Closures were available in some implementations for
>>> a specified set of special variables. N.B. that by LEXICAL scope we normally
>>> mean that nested function definitions see local bindings where ever they are
>>> executed - not so for LOCAL binding.
>>
>> See for example the definition of "closures" in the context of
>> Lisp-Machine-Lisp at https://hanshuebner.github.io/lmman/fd-clo.xml#closure
>
> Note that above I was talking about Lisps that predated the Lisp Machines.
>
>> Basically, they're functions that remember the value of dynbound
>> variables at the time that the closure was created and then rebind those
>> dynbound vars to those values around the evaluation of their body.
>
> There was no "rebinding". Rather the original binding was used by all
> who could see it vis a vis the scoping rules. Since multiple closures
> (including the one where that binding occurred) could reference the same
> lexical binding, creating multiple rebinding would screw the semantics.

By the way, I once made a (proprietary, closed source) Lisp dialect
which had dynamic scope, but with proper closures!

The dialect used deep binding for the dynamic scope. Basically it's
the same as lexical scope in a recursive interpreter, except that the
environment chain crosses the function call boundary.

Closures worked by actually walking the environment chain and capturing
it.

To make the closures lexical, the function activation frames had a
special marker in them to identify them. Thus the dynamic closure
capture mechanism was able to stop at that marker and not capture
beyond.

When calling a closure, the captured environment got spliced in, so that
the search for a dynamic variable would look at the function parameters
first, then the captured environment, then the calling environment.

This dialect also had threads.

I remember it was quite nice to be able to override special variables
around lambdas that executed in separate thread.

(let* ((*some-param* (whatever))
(thr (create-thread (lambda ...))))
...)

I was using that for testing API's on an embedded target, where the
some of the test functions could be controlled by various special
variable parameters.

I /think/ I may also have had dlambda construct that captured the
full dynamic scope across the function boundary, so this was possible:

(defun foo ()
(dlambda () ...))

The returned lambda would see bindings of dynamic variables as they
existed at the time foo was called.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: Is Lexical Binding The Norm Yet?

<uo9nmf$27uc5$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17850&group=comp.lang.lisp#17850

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Wed, 17 Jan 2024 23:26:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uo9nmf$27uc5$3@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<uo4id7$14ifr$1@dont-email.me>
<jwvedeg510z.fsf-monnier+comp.lang.lisp@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 23:26:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7b7eb05269adaf47ad0e7a8103a3b8bb";
logging-data="2357637"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189YuUtQa7KZkcKhgoFmawn"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:he/T1ejmOJmvqiR5IsF28Q90w6c=
 by: Lawrence D'Oliv - Wed, 17 Jan 2024 23:26 UTC

On Tue, 16 Jan 2024 18:16:02 -0500, Stefan Monnier wrote:

> In ELisp you could implement it as follows ...

Luckily, you can now specify it for the contents of a .el file with a
header comment:

;;; -*- lexical-binding: t; -*-

Re: Is Lexical Binding The Norm Yet?

<uo9o4k$281t4$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17851&group=comp.lang.lisp#17851

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Wed, 17 Jan 2024 23:33:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uo9o4k$281t4$1@dont-email.me>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<uo4id7$14ifr$1@dont-email.me>
<jwvedeg510z.fsf-monnier+comp.lang.lisp@gnu.org>
<uo9cbb$264u2$1@dont-email.me> <20240117122629.806@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 23:33:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7b7eb05269adaf47ad0e7a8103a3b8bb";
logging-data="2361252"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/n00T0Hz5eTYUQ3WKnOLxW"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:chobZxedwa3B1paM66tVySTa0KM=
 by: Lawrence D'Oliv - Wed, 17 Jan 2024 23:33 UTC

On Wed, 17 Jan 2024 20:37:43 -0000 (UTC), Kaz Kylheku wrote:

> By the way, I once made a (proprietary, closed source) Lisp dialect
> which had dynamic scope, but with proper closures!

I’m just a humble Python programmer, but it seems to me there are easier
ways of doing such things: create and instantiate a class.

Then you can define methods that access and update the internal state,
coupled with a method that says “do the actual work”. You can even manage
that internal state via assignable “properties”, instead of explicit
getter/setter method calls.

And for added flavour, if you define a “__call__()” method that does the
actual work, you can call the class instance as though it were a function.

Re: Is Lexical Binding The Norm Yet?

<20240117155210.850@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17853&group=comp.lang.lisp#17853

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-6894@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.lisp
Subject: Re: Is Lexical Binding The Norm Yet?
Date: Thu, 18 Jan 2024 00:06:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <20240117155210.850@kylheku.com>
References: <uo1i8c$jbru$2@dont-email.me>
<86r0ijsdyj.fsf@williamsburg.bawden.org> <871qajgr9k.fsf@nightsong.com>
<uo4id7$14ifr$1@dont-email.me>
<jwvedeg510z.fsf-monnier+comp.lang.lisp@gnu.org>
<uo9cbb$264u2$1@dont-email.me> <20240117122629.806@kylheku.com>
<uo9o4k$281t4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 18 Jan 2024 00:06:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d2d938dda3e1a6a4011b6cb72d132af7";
logging-data="2370459"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zpcsJDpqwlsEyWl9t5EyiYE+DP0Q1jhU="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:2UykkQJNeWuIPHtmrq1Yr+EPT0k=
 by: Kaz Kylheku - Thu, 18 Jan 2024 00:06 UTC

On 2024-01-17, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> On Wed, 17 Jan 2024 20:37:43 -0000 (UTC), Kaz Kylheku wrote:
>
>> By the way, I once made a (proprietary, closed source) Lisp dialect
>> which had dynamic scope, but with proper closures!
>
> I’m just a humble Python programmer, but it seems to me there are easier
> ways of doing such things: create and instantiate a class.

Whether or not that is true, that dialect didn't evolve to the point
it had objects. I quit that company and trained for a marathon for 3
months instead of working anywhere. 5 days a week of weights, 6 days
of running. I hit a time of 3 hours and 19 minutes, with no natural
talent or anything, and well over thirty.

I caught word from the manager that he also bailed two weeks later
and the project folded.

While I was training for the marathon, the resumes I had sent out at the
beginning of the three month period started to gain traction. I got hired at a
new place, and my starting day was exactly the Monday after the Sunday marathon
race.

Good times!

> Then you can define methods that access and update the internal state,
> coupled with a method that says “do the actual work”. You can even manage
> that internal state via assignable “properties”, instead of explicit
> getter/setter method calls.

I think all that would have been verbose compared to the dynamic closures,
but of course it provides tighter encapsulation.

> And for added flavour, if you define a “__call__()” method that does the
> actual work, you can call the class instance as though it were a function.

In TXR Lisp that is called lambda. No ugly underscores, because the
lambda symbol is properly packaged: you can have my:lambda in your own
package called "my" or whatever which doesn't clash with usr:lambda.

1> (defstruct functor ()
(:method lambda (me arg) (put-line `@me: @arg!`)))
#<struct-type functor>
2> (new functor)
#S(functor)
3> [*2 42]
#S(functor): 42!
t

There is also a lambda-set which will let the call expression
denote a place that can take assignments:

4> (defmeth functor lambda-set (me arg new-val)
(put-line `@me: @arg set to @{new-val}!`))
(meth functor
lambda-set)
5> (set [*2 42] :blah)
#S(functor): 42 set to :blah!
:blah

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor