[racket] module->language-info at repl
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.
At Thu, 01 Sep 2011 13:01:48 -0600, Jon Rafkind wrote:
> More details on how my system is setup:
>
> 1. Make a directory for a new language called Z
> 2. Edit Z/lang/reader.rkt and put this in there
> #lang s-exp syntax/module-reader
>
> Z
>
> #:info z-info
>
> (define (z-info key default filter)
> (printf "called z-info\n")
> (filter key default))
>
> 3. Edit Z/main.rkt
> #lang racket/base
> (provide (all-from-out racket/base))
>
> 4. Run with the Z language
> $ PLTCOLLECTS=`pwd`:$PLTCOLLECTS racket -Iq Z
> Welcome to Racket v5.1.3.6.
> >
>
> At this point I would expect it to say "called z-info" to try to set up the
> runtime.
>
>
> On 09/01/2011 12:50 PM, Jon Rafkind wrote:
> > The repl doesn't seem to invoke the module language's get-info procedure. My
> #lang has a `get-info' procedure that is passed to the module-reader by #:info
> > honu-info. get-info is defined as
> >
> > (provide honu-info)
> > (define (honu-info key default default-filter)
> > (printf "get info for ~a\n" key)
> > (case key
> > [(color-lexer) (dynamic-require 'honu/core/read
> > 'color-lexer)]
> > [(configure-runtime) `(#(honu/core/runtime configure))]
> > [else
> > (default-filter key default)]))
> >
> > It seems only drracket will call `get-info', though. Is there a way to make
> the repl call this as well, and if it doesn't can we make it?
> > _________________________________________________
> > For list-related administrative tasks:
> > http://lists.racket-lang.org/listinfo/users
>
> _________________________________________________
> For list-related administrative tasks:
> http://lists.racket-lang.org/listinfo/users