On 09/30/2015 07:55 AM, Matthew Flatt wrote:
I'm fixing a bug in the implementation's handling of use-site scopes,
and that makes your example above work correctly. The bug is a holdover
from an earlier, broken idea of how to handle use-site scopes. Getting
rid of it --- bringing the implementation in line with the paper ---
solves the problem while the core test suite still passes and the main
distribution builds.

Thanks!

I think the examples in the paper are still correct, and it's still the
case that

  (let ()
    (def-m m x)
    (m))

resolves the ambiguity. However, with the repaired expander, it's also
the case that

  (def-m m x)
  (let ()
    (m))

resolves the ambiguity, in contrast to my earlier response. The
ambiguity depends (as originally intended) on a single definition
context shared by `def-m`, `m`, and `given-x`.

This makes sense to me now.

Similarly, it's still the case that

  (define x 'outer)

  (define-syntax-rule (def-m m given-x)
    (define-syntax-rule (m)
      (begin
        (define given-x 'inner)
        x)))

  (def-m m x)
  (m)

produces 'inner with the new expander and 'outer with the old one.
Again, though, the result is 'outer when adding a `(let () ....)`
around the last two lines, around just the `(m)`, or in place of the
`(begin ....)` within the definition of `m` --- any of which introduces
a more nested context for the definition of `given-x`.

I've gone back and forth on this a few times in my head, but I think I've settled on believing that this makes sense. I will give tomorrow's snapshot a try and see if my current mental model matches reality.
--
Brian Mastenbrook
[email protected]
https://brian.mastenbrook.net/

--
You received this message because you are subscribed to the Google Groups "Racket 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/560C9D7F.4090509%40mastenbrook.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to