Re: [Scheme-reports] Formal Comment: clarify the semantics of the dynamic features Alex Shinn 29 Jun 2012 18:24 UTC

On Thu, Jun 28, 2012 at 4:21 PM, Richard Kelsey <kelsey@s48.org> wrote:
>   Date: Thu, 28 Jun 2012 17:55:54 -0400
>   From: John Cowan <cowan@mercury.ccil.org>
>
>   Richard Kelsey scripsit:
>
>   > For example, dynamic bindings are described using the term 'dynamic
>   > environment' which is itself not defined.  There is a paragraph on
>   > how dynamic bindings interact with threads, which are not mentioned
>   > anywhere else in the report, but nothing is said about how dynamic
>   > bindings interact with call/cc or dynamic-wind.
>
>   The intention is that dynamic bindings are implemented either directly
>   by dynamic-wind, or using the same underlying mechanisms.  Perhaps the
>   report should say "as if by dynamic-wind"?
>
> The report should describe the semantics of dynamic variables, not one
> particular implementation.

The report describes the semantics in terms of dynamic extent,
so the analogy to dynamic-wind seems appropriate.

We do need to be careful here, and the WG has not yet had
time to fully review the non-call/cc-based dynamic-binding
research pointed out by Oleg.

> I don't see how the R7RS dynamic variables would work with any thread
> package at all, portable or non-portable, that preserves the semantics
> of dynamic-wind.  You can't unwind and wind on context switch, so if
> you have threads you can't use dynamic-wind or any other shallow-binding
> mechanism to implement dynamic variables.  I think you have to use deep
> binding.
>
>   As the SRFI notes, this is currently done in various ways.
>
> Which SRFI?

SRFI-39 on which the R7RS parameters were based.

>   > - Ideally, the dynamic environment and dynamic-wind would be included
>   >   in the formal semantics.
>
>   If anyone has a proposal here, it might be a Good Thing, but I wouldn't
>   know the difference between up and Tuesday when it comes to the formal
>   semantics, so I must decline either to write it or to edit it.
>
>   Editorial tickets #427 and #428 created.  Ballot ticket #429 for new
>   formal semantics created.  If nobody steps up to do this and review it
>   before the last ballot, it will be closed.
>
> If the WG makes changes to the language that require changes to the
> formal semantics, then they need to change the formal semantics.  That
> seems like part of the job.

The formal semantics only covered a small subset of the
language to begin with.  The change in question is equivalent
to adding a formal semantics for dynamic-wind, which was
already missing from R5RS.  I agree, of course, that we should
fix this, or consider using (a subset of) the operational semantics
from R6RS (which again is a subset of the language but at least
has dynamic-wind).

--
Alex

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports