[plt-scheme] load non-exported symbols from a file
At Wed, 14 May 2008 12:47:48 +0100, Filipe Cabecinhas wrote:
> Is it possible to load every defined symbol from an R6RS program so I
> can use use them to do some tests?
An R6RS program is a PLT Scheme module, so you can use reflection
operations like `module->namespace' to get inside the program.
For example, if "ex.ss" contains
#!r6rs
(import (rnrs))
(define one 1)
(define two 2)
then
> (require "ex.ss")
> (define ns (module->namespace "ex.ss"))
> (eval 'one ns)
1
> (eval 'two ns)
2
Matthew