Hi, I noticed that top level (define-values ...) forms create bindings that include the top-level-bind-scope (of the namespace's root-expand-context), and have two questions related to this.
First, in the source file expander/expand/bind-top.rkt, there is a comment that says "When compiling `(define-values (x) ...)` at the top level, we'd like to bind `x` so that a reference in the "..." will point back to the definition, as opposed to being whatever `x` was before." Isn't this the exact opposite of what (define-values (x) ...) should do? Second, ignoring the comment mentioned above, but still consider `(define-values (x) ...)`. It appears that the binding of `x` to `...` with the top-level-bind-scope is only used by `(#%top . x)` (either explicit or implicit). The only exception seems to be in contexts where neither `x` nor #%top are binded, in which case `x`, not wrapped by #%top, also uses that binding. The case of `(#%top . x)` is confusing because even without the top-level-bind-scope binding of `x`, `(#%top . x)` can still locate `(define-values (x) ...)`, otherwise mutually recursive functions won't work at the top level. As for the exception case, it seems rare enough that it can be ignored. So my question is, what's benefit does the top-level-bind-scope bring? Thanks! -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/3a1ee8c8-a990-4337-840a-5458d2ee36c7%40googlegroups.com.