[racket] improving speed of namespace attachment/requiring?

From: Danny Yoo (dyoo at hashcollision.org)
Date: Thu Feb 28 18:38:05 EST 2013

> Below is one way to do it, although probably there should be an easier
> way.
>
> ----------------------------------------
>
> #lang racket/base
>
> (define make-fresh-namespace (eval
>                               '(lambda ()
>                                  (variable-reference->empty-namespace
>                                   (#%variable-reference)))
>                               (make-base-namespace)))
[code cut]


Ok.  I have no idea how this works, but it does.  :)  This is exactly
what I needed.  Compilation times now go to about zero when I generate
fresh namespaces this way.  Thank you!

For reference: https://github.com/dyoo/whalesong/blob/repl/whalesong/repl-compile.rkt

Posted on the users mailing list.