Bonjour,

> There’s the ,expand command at the REPL.
>
> It’s implemented like this:
>
>   (define (repl-expand repl form)
>     (let ((from (repl-language repl))
>           (opts (repl-compile-options repl)))
>       (decompile (compile form #:from from #:to 'tree-il #:opts opts
>                           #:env (current-module))
>                  #:from 'tree-il #:to from)))
>
> Psyntax, the macro expander, returns tree-il, hence the need to go
> through ‘decompile’.

Thanks a lot. By the way, the (undocumented, as of 2.0.5) decompile
function returns two values -- the first being the expanded expression
and the second -- #f.
As I've figured out from system/base/compile, the second return value
is the environment, but I've been wondering under what circumstances
would that value be different from #f.

Best regards
MG

Reply via email to