Re: [racket-users] Is there a way to eval a custom language from inside a module... without instantiating modules multiple times?

2018-11-16 Thread Andrew Wilcox
> > 2. Just use the same namespace as eval-example.rkt > I had tried this, but it evals not just the example language but Racket+example (i.e. Racket forms also eval, and the example language has to be compatible with Racket). 1. Keep the new namespace, but use namespace-attach-module to

Re: [racket-users] Is there a way to eval a custom language from inside a module... without instantiating modules multiple times?

2018-11-16 Thread Matthew Butterick
You've mentioned that you want to "define a custom language" and evaluate it. But so far I don't see any sign that you're using Racket's dedicated facilities for doing this (especially `#%module-begin` and `module`). If this is a deliberate choice, carry on. If not, consider investigating them,

Re: [racket-users] Is there a way to eval a custom language from inside a module... without instantiating modules multiple times?

2018-11-16 Thread Shu-Hung You
On Fri, Nov 16, 2018 at 12:43 PM Andrew Wilcox wrote: > > I'd like to be able to eval a custom language from inside a module... without > instantiating modules multiple times. > > With the help of Matthew Butterick, I've gotten this far: > > ; runtime.rkt > #lang racket > > > (printf "This is

[racket-users] Is there a way to eval a custom language from inside a module... without instantiating modules multiple times?

2018-11-16 Thread Andrew Wilcox
I'd like to be able to eval a custom language from inside a module... without instantiating modules multiple times. With the help of Matthew Butterick, I've gotten this far: ; runtime.rkt #lang racket (printf "This is runtime.rkt~n") ; example.rkt #lang racket (require "runtime.rkt")