Email list hosting service & mailing list manager

Library semantics correction Andre van Tonder (03 Dec 2005 17:19 UTC)
Re: Library semantics - higher level imports Andre van Tonder (04 Dec 2005 14:39 UTC)
Re: Library semantics - higher level imports Andre van Tonder (04 Dec 2005 14:51 UTC)

Library semantics correction Andre van Tonder 03 Dec 2005 17:12 UTC

With the semantics as stated in the document, a library will only ever
be visited at phase 0, so a recursion step seems to be missing.  Indeed,
the following example is not covered:

   (library "m" "scheme"
     (export u)
     (define-syntax u (lambda (exp) (syntax 1)))

   (library "n" "scheme"
     (import (for "m" syntax))
     (define-syntax v (lambda (exp) (u)))

Indeed, visiting "n" at phase 0 requires "m" to be visited at phase 1 (because
there is a reference to the macro u on the right hand side of the
definition of v.

Here is what I think needs to be added:

To visit a library at phase N:

     * Visit at phase N any library that is imported by this library for run time,
       and that is not yet visited at phase N.
     * Invoke at phase N+1 any library that is imported by this library for .... expand,
       and that is not yet invoked at phase N+1.

[ADDITION]
     * Visit at phase N+1 any library that is imported by this library
       for .... expand, and that is not yet visited at phase N+1.
[END ADDITION]

     * Evaluate all syntax definitions within the library.
       (Top-level expressions are not evaluated, and the right-hand sides
       of variable definitions are not evaluated.)

Regards
Andre