[Scheme-reports] Formal Comment: clarify the semantics of the dynamic features Richard Kelsey (28 Jun 2012 14:56 UTC)

[Scheme-reports] Formal Comment: clarify the semantics of the dynamic features Richard Kelsey 28 Jun 2012 14:49 UTC

Formal Comment

Submitter's name: Richard Kelsey
Submitter's email: kelsey at s48.org
Relevant draft: r7rs draft 6

Type: clarification
Priority: major
Relevant section of draft: Derived expressions, control features, exceptions

Summary: The descriptions of the dynamic features need to be clearer
 and more consistent.

There are now three separate features that relate to the dynamic
context: dynamic-wind, dynamic bindings, and exception handling.
These need to be defined in some unified way and their interaction
described.

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.

Suggestion:

- Add a new section 3.6 that includes the definition of 'dynamic
  extent' currently in section 6.10 and a definition of 'dynamic
  environment'.  Mention that the dynamic environment is captured
  by call/cc.  Say something about threads, if necessary.

- Remove the paragraph about threads from the section on dynamic
  bindings.

- In the description of dynamic-wind, say that dynamic environment
  is in place when the before and after thunks are called is the
  the dynamic environment of the call to dynamic-wind.

- 6.11 paragraph 2; change
   The system implicitly maintains a current exception handler.
  to
   The system implicitly maintains a current exception handler
   in the dynamic environment.

- Description of with-exception-handler; change
   Handler is installed as the current exception handler for the
   dynamic extent (as determined by dynamic-wind) of the invocation of
   thunk .
  to
   Handler is installed as the current exception handler in the
   dynamic environment used for the invocation of thunk.

- The description of raise talks about the dynamic extent of
  continuations, but it is calls that have a dynamic extent,
  not continuations.  Rephrase it in terms of continuations
  and dynamic environments.

- The description of raise-continuable also needs to be rephrased
  in terms of continuations and dynamic environments.

- Ideally, the dynamic environment and dynamic-wind would be included
  in the formal semantics.

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