<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Do you mean something like this?:</div><div><br></div><div><font face="Courier New">(provide (rename-out [-#%module-begin #%module-begin]))</font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New">(define-syntax-rule (-#%module-begin form ...)</font></div><div><font face="Courier New"> (#%module-begin</font></div><div><font face="Courier New"> (module configure-runtime racket/base</font></div><div><font face="Courier New"> (current-prompt-read</font></div><div><font face="Courier New"> (let ([old-prompt-read (current-prompt-read)])</font></div><div><font face="Courier New"> (lambda ()</font></div><div><font face="Courier New"> (parameterize ([current-readtable (make-readtable-for-my-lang)])</font></div><div><font face="Courier New"> (old-prompt-read))))))</font></div><div><font face="Courier New"> form ...))</font></div><div><br></div><br><div><div>On Oct 24, 2014, at 11:19 PM, Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I think a `configure-runtime` submodule (in the expansion of any module<br>using the language) is the right place for this kind of configuration.<br><br>The `configure-runtime` submodule is similar to `main`, it that it is<br>only used when the enclosing module is the main module of a program.<br><br>Instead of a direct `(current-readtable ...)`, I think you'll want a<br>direct `(current-prompt-read ...)`, where the prompt read handler uses<br>`(parameterize ([current-readtable ...]) (read-syntax ...))`.<br><br>At Fri, 24 Oct 2014 22:56:37 -0400, "Alexander D. Knauth" wrote:<br><blockquote type="cite">Is there a way to specify a reader for the repl for a language?<br><br>One bad way to do this would be to modify #%module-begin to include<br>(current-readtable (make-readtable-for-my-lang))<br>or something like that.<br>See<br><a href="https://github.com/greghendershott/rackjure/pull/46">https://github.com/greghendershott/rackjure/pull/46</a><br>https://github.com/greghendershott/rackjure/pull/46#issuecomment-60378324<br><br>One problem with this is that if this module is required from a module without <br>this language, it would affect that module’s current-readtable. <br><br>So is there a better solution, and if there’s not, would it be possible to add <br>it?<br><br><br><br>____________________<br> Racket Users list:<br> http://lists.racket-lang.org/users<br></blockquote></blockquote></div><br></body></html>