[racket] module->language-info at repl
At Thu, 1 Sep 2011 16:02:06 -0400, Sam Tobin-Hochstadt wrote:
> On Thu, Sep 1, 2011 at 3:43 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> > Instead of `#:info', you want to specify `#:language-info'.
> >
> > The `#:info' hook is for things related to the *source* of a module in
> > the language, such as syntax coloring in DrRacket for a module that
> > start `#lang Z'. The plain `racket' REPL doesn't deal with the module's
> > source at all in that sense.
> >
> > The `#:language-info' hook is for things related to *running* a module
> > that starts `with `#lang Z'. When such a module is provided to
> > `racket', then `racket' uses `configure-runtime' before instantiating
> > the module.
>
> This doesn't seem to be working for me. That is, the `datalog'
> collection has a `#:language-info' specification, which sets the
> `current-read-interaction' parameter, but it seems to only affect
> DrRacket, not the plain REPL.
>
> [samth at punge:~/sw/plt/collects (master) plt] r -qil datalog
> Welcome to Racket v5.1.3.6.
> > 3
> 3
> > (+ 3 4)
> 7
>
> Welcome to DrRacket, version 5.1.3.6--2011-09-01(0a93109/g) [3m].
> Language: datalog [custom]; memory limit: 512 MB.
> > 3
> . datalog: Unexpected token EOF in: #f
> > (+ 3 4)
> . datalog: Unexpected token LPAREN in: #f
I imagine that in DrRacket you've used a program
#lang datalog
and so it uses the `datalog' runtime configuration.
In contrast, `racket -l datalog' runs a program
".../collects/datalong/main.rkt" that starts
#lang racket/base
and so it uses the `racket/base' runtime configuration.