<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;"><br><div><div>On Oct 25, 2014, at 12:09 AM, Alexander D. Knauth <<a href="mailto:alexander@knauth.org">alexander@knauth.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Oct 24, 2014, at 11:56 PM, Alexander D. Knauth <<a href="mailto:alexander@knauth.org">alexander@knauth.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div 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></div></blockquote><div><br></div><div>I just tried this and it didn’t work.  </div><div><br></div><div>Is there anything else I could need to do to make something like this work?</div></div></div></blockquote><div><br></div><div>Ok I tried using current-read-interaction instead of current-prompt-read and that worked.  </div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div><br></div><div>And also would this conflict with other configure-runtime submodules that might be created?  </div><div><br></div></div></div></blockquote><div><br></div><div>But what about this?</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><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><a href="https://github.com/greghendershott/rackjure/pull/46#issuecomment-60378324">https://github.com/greghendershott/rackjure/pull/46#issuecomment-60378324</a><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>  <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></blockquote></div><br></div>____________________<br>  Racket Users list:<br>  <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></div></blockquote></div><br></body></html>