sorawee
2020-9-12 20:09:18

@mflatt

If I have:

(list (let ([c '1]) (let ([c '3]) ...)) (let ([c '2]) ...)) where [c '1] is pink, [c '2] is orange, and [c '3] is both pink and orange, would there conceptually be ambiguity on resolving pink and orange? (I know your algorithm wouldn’t find an ambiguity)


mflatt
2020-9-12 20:11:58

I would say there’s no ambiguity, and it might even be sensible if the list expression was the expansion of some syntactic form with overlapping but non-nested scopes.


sorawee
2020-9-12 20:13:03

Thanks!


sorawee
2020-9-12 22:09:46

I’m trying to understand why it’s OK to use empty-env here, and would empty-env suffices if we need to support syntax-local-value.


mflatt
2020-9-12 22:19:46

The little model here has no for-syntax imports or any compile-time binding, so every let-syntax right-hand side is in an empty environment. To support syntax-local-value, you need some way of accessing the environment at the point where eval-for-syntax-binding was called (maybe through a continuation mark, which is how the actual implementation works), but you still wouldn’t pass that environment to expand.