I'm trying to write a macro that reflects on which identifiers are in scope in
the environment when it runs, and on the identifiers in scope for its generated
code.
It should act something like this:

  (define-syntax (display-env stx)
    (syntax-case stx ()
      [(_)
       (printf "Env: ~a" (local-environment))]))

  > (lambda (x) (display-env) x)
  Env: '(x)
  #<procedure>
  > (lambda (x) (let-syntax ([y (make-rename-transformer #'x)]) (display-env) 
y))
  Env: '(y x)
  #<procedure>

Presumably, the expander knows which identifiers are in scope, so I *ought* to
be able to get my hands on that set.

namespaces aren't the thing; they only give me access to the top-level
definitions, as far as I can tell.
I also want access to any lexical identifiers introduced by `λ` or `let` or
`let-syntaxes` or `let-values` etc.
But I want to be able to use them pretty much like namespaces: get the list of
symbols in scope, and get their values and identifiers.

Any one know how to do this?

-- 
William J. Bowman

-- 
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/20190717203517.GD86511%40williamjbowman.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to