Alexis King
unread,Jun 3, 2016, 6:28:32 PM6/3/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to dev
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