Re: scope Sergei Egorov (20 Oct 2025 17:08 UTC)
Re: scope / order Sergei Egorov (20 Oct 2025 17:34 UTC)
Re: scope / order Daphne Preston-Kendal (25 Oct 2025 10:55 UTC)
Re: scope / order Marc Nieper-Wißkirchen (25 Oct 2025 11:36 UTC)
Re: scope / order Sergei Egorov (25 Oct 2025 15:05 UTC)
Re: scope / order Arthur A. Gleckler (25 Oct 2025 18:30 UTC)
Re: scope / order Daphne Preston-Kendal (26 Oct 2025 21:56 UTC)
Re: scope / order Daphne Preston-Kendal (26 Oct 2025 22:22 UTC)
Re: scope / order Sergei Egorov (26 Oct 2025 23:49 UTC)
Re: scope / order Arthur A. Gleckler (27 Oct 2025 00:05 UTC)
Re: scope / order Sergei Egorov (27 Oct 2025 00:11 UTC)
Re: scope / order Marc Nieper-Wißkirchen (27 Oct 2025 09:22 UTC)
Re: scope / order Daphne Preston-Kendal (27 Oct 2025 09:42 UTC)
Re: scope / order Marc Nieper-Wißkirchen (27 Oct 2025 10:14 UTC)
Re: scope / order Sergei Egorov (27 Oct 2025 16:46 UTC)
Re: scope / order Daphne Preston-Kendal (26 Nov 2025 23:00 UTC)
Re: scope / order Sergei Egorov (27 Nov 2025 01:14 UTC)
Re: scope Daphne Preston-Kendal (20 Oct 2025 18:48 UTC)
Re: scope Sergei Egorov (20 Oct 2025 20:40 UTC)
Re: scope Wolfgang Corcoran-Mathe (20 Oct 2025 21:56 UTC)

Re: scope Daphne Preston-Kendal 20 Oct 2025 18:47 UTC

On 20 Oct 2025, at 19:08, Sergei Egorov <xxxxxx@acm.org> wrote:

> The scope is not unspecified, it is specified operationally, by imposing constraints that should hold for a program to have a defined semantics. Not a new thing for Scheme: this is the approach taken by R6RS/R7RS editors with respect to define-syntax in bodies.

This seems to be a rather deep misunderstanding.

In my example, (match procedure? ((~and thing (~? thing)) 'early-binding) (_ 'should-never-happen)), your proposed spec language makes the binding of ‘thing’ in the evaluation of the expression in (~? thing) unspecified. If a binding is unspecified, the scoping rules are unspecified. (Worse than unspecified, because there is no obligation for an implementation to do one of the ‘obvious’ things when something is specified as UB. If it were merely unspecified, it would at least be safe.)

There is no case in R6RS which is unspecified in this way. In R7RS small, there is no real comparable case, only that of syntactic use-before-definition within a body, which is unspecified, but use after definition, which this example lexically is, is perfectly well specified. (Though I note your ~and doesn’t guarantee left-to-right order nor by extension short circuiting.) The situation in the draft R7RS large is the same as in R6RS.

Daphne