Closed aBathologist closed 9 years ago
To make sure I understand, you're experiencing this only in REPLs? But it works fine in a source file that has #lang rackjure
at the top?
If so, the answer is that I don't know if/how it is possible for a REPL to use a different readtable automatically. You'll need to tell it. For example in racket-mode's *Racket REPL*
:
> (require rackjure/lambda-reader)
> (current-readtable lambda-readtable)
> (map #λ(+ % 1) '(1 2 3))
'(2 3 4)
So that works. Unfortunately, the next time you do Run
(require rackjure/lambda-reader)
and (current-readtable lambda-readtable)
in that source file. (Using #lang rackjure
effectively does this for you, for the source file. Putting this in the source file is just a work-around for making it take effect in the REPL, too.)
I don't feel like this is a really satisfying answer for you. Maybe there is something I am overlooking about how to make this more automatic.
Ah! I'm afraid the problem is that I'm just know too little! I wasn't aware of this discrepancy between the REPL read table and that of the source file using #lang rackjure
. Had I known, I wouldn't have mentioned it! Sorry for the bother, and thanks very much for the clarification. I don't even need the reader function in the REPL, but your solution is completely satisfactory for my purposes! It's a very pleasant bit of sugar.
Thanks heaps for racket-mode and, again, I'm sorry for the bother.
No worries at all -- I'm glad you reported this. It's completely reasonable to expect this to "just work" in the REPL, too. I wish it did. I just don't understand how to make it do so.
Would it make sense to modify #%module-begin to put the
(require rackjure/lambda-reader)
(current-readtable lambda-readtable)
in the module body for you? Edit: or maybe this would be better:
(require rackjure/lambda-reader)
(current-readtable (make-lambda-readtable (current-readtable)))
Further Edit: Or it would be better to use either a configure-runtime submodule or the #:language-info option and a runtime-config.rkt
@aBathologist this should work now if you update
@AlexKnauth thanks!
I'm receiving an error *only with the reader function literals. Everything else is working swell (lots of fun!). This is with Racket version 6.1 running on OS X Mavericks, in DrRacket:
In emacs, with racket-mode, I get the following
Let me know if I can do anything to help! Or if it looks like a problem just on my end.