On Oct 25, 2014, at 12:09 AM, Alexander D. Knauth <alexan...@knauth.org> wrote:
> > On Oct 24, 2014, at 11:56 PM, Alexander D. Knauth <alexan...@knauth.org> > wrote: > >> Do you mean something like this?: >> >> (provide (rename-out [-#%module-begin #%module-begin])) >> >> (define-syntax-rule (-#%module-begin form ...) >> (#%module-begin >> (module configure-runtime racket/base >> (current-prompt-read >> (let ([old-prompt-read (current-prompt-read)]) >> (lambda () >> (parameterize ([current-readtable (make-readtable-for-my-lang)]) >> (old-prompt-read)))))) >> form ...)) >> > > I just tried this and it didn’t work. > > Is there anything else I could need to do to make something like this work? Ok I tried using current-read-interaction instead of current-prompt-read and that worked. > > And also would this conflict with other configure-runtime submodules that > might be created? > But what about this? > > >> >> On Oct 24, 2014, at 11:19 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: >> >>> I think a `configure-runtime` submodule (in the expansion of any module >>> using the language) is the right place for this kind of configuration. >>> >>> The `configure-runtime` submodule is similar to `main`, it that it is >>> only used when the enclosing module is the main module of a program. >>> >>> Instead of a direct `(current-readtable ...)`, I think you'll want a >>> direct `(current-prompt-read ...)`, where the prompt read handler uses >>> `(parameterize ([current-readtable ...]) (read-syntax ...))`. >>> >>> At Fri, 24 Oct 2014 22:56:37 -0400, "Alexander D. Knauth" wrote: >>>> Is there a way to specify a reader for the repl for a language? >>>> >>>> One bad way to do this would be to modify #%module-begin to include >>>> (current-readtable (make-readtable-for-my-lang)) >>>> or something like that. >>>> See >>>> https://github.com/greghendershott/rackjure/pull/46 >>>> https://github.com/greghendershott/rackjure/pull/46#issuecomment-60378324 >>>> >>>> One problem with this is that if this module is required from a module >>>> without >>>> this language, it would affect that module’s current-readtable. >>>> >>>> So is there a better solution, and if there’s not, would it be possible to >>>> add >>>> it? >>>> >>>> >>>> >>>> ____________________ >>>> Racket Users list: >>>> http://lists.racket-lang.org/users >> >> ____________________ >> Racket Users list: >> http://lists.racket-lang.org/users >
____________________ Racket Users list: http://lists.racket-lang.org/users