Discussion:
[Larceny-users] larceny command line
Jon Wells
2011-03-01 02:24:08 UTC
Permalink
It seems that the argument to the -e option is always evaluated in r5
mode. Is there a reason for that? It'd be nice to be able to...

larceny -err5rs -- -e '(import (guff))'

and land up in a repl with guff imported.

I don't mind hacking my own version to do this, provided I'm not going
to shoot myself in the foot in some very complicated way by doing so.

jon.
w***@ccs.neu.edu
2011-03-01 04:52:57 UTC
Permalink
Post by Jon Wells
It seems that the argument to the -e option is always evaluated in r5
mode. Is there a reason for that? It'd be nice to be able to...
larceny -err5rs -- -e '(import (guff))'
and land up in a repl with guff imported.
I don't mind hacking my own version to do this, provided I'm not going
to shoot myself in the foot in some very complicated way by doing so.
It looks as though you're asking for the -e option to work in
ERR5RS and R6RS modes as well as R5RS mode.

In R6RS mode, the -e option is incompatible with the semantics
of the -- option, which sends everything that follows to the
R6RS top-level program. Faced with the choice of making the
ERR5RS mode compatible with R5RS or R6RS mode in this respect,
we made it compatible with R6RS mode. If we hadn't, it would
have been hard to debug R6RS programs in ERR5RS mode.

We could support an equivalent of the -e option that precedes
the -- option instead of following it, but that would add hair
to the command-line processing that's done in C or C#, and we
have been trying to simplify Larceny's command-line processing.

For a proposed solution to the inconvenience of having to type
an import in ERR5RS mode, see ticket #664:
https://trac.ccs.neu.edu/trac/larceny/ticket/664

Will

Loading...