Currently, it does not seem like there is any option to open a new
command-line REPL for a particular #lang. Based on what already exists,
I’m not sure if this is a bug or if it’s intended (or perhaps
overlooked) behavior.

The -I command line flag to the racket executable states that sets the
<init-lib>, with a note explaining that it sets the language. This is
not quite true, however: it appears to do more than simply requiring the
module into the top-level namespace, but it’s not setting the #lang —
instead, it seems to simply open a REPL as if you started a REPL in
DrRacket inside the specified module.

This sounds similar, but it’s not: if I have a language called “foo”,
implemented in foo/lang/reader, then run `racket -I foo`, the module
that is required is just foo, not foo/lang/reader. This means that the
language used is actually whatever #lang is present in the foo module,
which might not be #lang foo at all — it might be racket/base, or even
anything else. Interestingly, this is the case for typed/racket/gui:
using typed/racket and typed/racket/base works with the -I flag because
they are implemented using the typed-racket/minimal language, but using
typed/racket/gui does not enable the #{x : T} reader syntax because it
is implemented with racket/base.

It seems like it would be valuable to either make -I do what I think its
description would cause most people to expect or to add another option
that is just like running a REPL in DrRacket in an empty module with a
particular #lang line. I’d guess it might be a good idea to make it a
separate flag, since I could imagine the behavior of -I being used
intentionally, so maybe another flag? Is there some other way to achieve
this behavior with the current set of options that I don’t know about?

Alexis

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/3D19950F-02D4-4AA4-868C-CB8EFA58FDE6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to