[racket] make-evaluator and (old style) planet packages
Unfortunately the language I am using does not provide a #%top-interaction,
so REPL like interactions won't work. All it provides is #%module-begin.
What I really want is to evaluate:
#lang planet dyoo/bf
SOME-PROGRAM
where SOME-PROGRAM is determined at runtime. I'm guessing sandboxed
evaluators are not the way to go?
--Spencer
On Thu, Sep 26, 2013 at 10:11 PM, Eli Barzilay <eli at barzilay.org> wrote:
> 40 minutes ago, Spencer florence wrote:
> > How can I use make-evaluator with a planet package as a language?
> >
> > If I were to do (make-evaluator '(planet dyoo/bf:1:8/language))
> >
> > I get the error "#%require: not at top-level or in module body in:
> > (#%require (planet dyoo/bf:1:8/language))"
>
> You should generally prefer `make-module-evaluator', which is similar
> to getting a DrRacket REPL in the context of a language rather than
> `make-evaluator' which is more like running a Racket REPL. Something
> like
>
> (make-module-evaluator '(module foo (planet dyoo/bf:1:8/language)))
>
> or
>
> (make-module-evaluator "#lang planet dyoo/bf:1:8/language")
>
> But I don't remember if it'll do what you want wrt getting strings and
> using a custom reader.
>
> --
> ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
> http://barzilay.org/ Maze is Life!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130926/0ccb0afd/attachment.html>