The -l option loads a module path. As `racket --help` documents, `-l <path>` is 
equivalent to `-e '(require (lib "<path>"))'`. Since (require (lib "at-exp 
racket")) won’t help you much, neither will `-l 'at-exp racket'`. I’m not 
totally sure why you thought `-l` was the right option here, but it doesn’t set 
the language.

It would be useful to have an option that does set the language, but it isn’t 
completely clear precisely what such an option ought to do. Unfortunately, the 
way the #lang protocol interacts with the REPL is indirect and complicated. The 
protocol is documented in the section of the reference entitled “Language 
Run-Time Configuration”: 
https://docs.racket-lang.org/reference/running-sa.html#%28part._configure-runtime%29
 
<https://docs.racket-lang.org/reference/running-sa.html#(part._configure-runtime)>

The root problem is the protocol operates on a module. A module written in a 
given #lang can generate a configure-runtime submodule or attach a syntax 
property property to its read body, but these both require a module written in 
the #lang already exist. The DrRacket REPL always operates in the context of 
some module (given in the definitions window), but the REPL run from the 
command line has no such luxury. Theoretically, some option could be added to 
generate an empty module in a specified #lang and use it to configure the REPL 
environment, but an empty module may not be a legal program in every #lang.

Furthermore, `at-exp racket` is not really a #lang, anyway. The #lang is just 
`at-exp`; the body of the module happens to start with the symbol `racket`. The 
`at-exp` reader reads the first symbol of its body and uses that symbol as a 
language path, then calls that language’s reader after installing the 
@-expression readtable. Again, this protocol only makes sense in the context of 
reading a module, and a module that starts with `#lang at-exp racket` doesn’t 
really have an empty body at all.

> On Mar 2, 2020, at 18:52, Faré <fah...@gmail.com> wrote:
> 
> On Mon, Mar 2, 2020 at 5:22 PM Michael MacLeod
> <michaelmmacl...@gmail.com> wrote:
>> 
>> $ racket -i -l scribble/reader -e "(use-at-readtable)" -l 
>> your-lang-without-@-support
>> 
>> should do the trick.
>> 
> Thanks. It works like a charm. But isn't a very nice recipe.
> Are there reasons why -l 'at-exp racket' sdhouln't be made to work?
> (Beside resource availability)
> 
> —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
> The people cannot delegate to government the power to do
> anything which would be unlawful for them to do themselves.
>        — John Locke, "A Treatise Concerning Civil Government"

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/68443BE8-9CE7-4417-82CC-C727CAFDB38D%40gmail.com.

Reply via email to