Closed pclouds closed 4 years ago
It's explainable as follows.
-e
only expects one S-expr, so in the first command line, it only reads the first import expression and ignores the rest. -e
expression is evaluated in the user
module. Evaluating (import (scheme base))
switches the current module to r7rs.user
but that doesn't affect the second -e
.begin
makes it work in Gauche, but that's outside of R7RS.I think the most intuitive solution is to allow multiple S-exprs contained in one -e
option.
Yeah I kinda expected multiple expressions in '-e' initially. That would be good improvement without breaking anything. The -u
(and -m
too) could probably accept r7rs libraries too (i.e. separated by spaces; with or without ()
), at least when -r7
is specified.
Never mind the -u
comment. I just realized that chibi, r7rs-only scheme, also accepts module.name not 'module name' from command line. Easier to type is the reason, i guess.
Caveat: I don't read r7rs from top down, I'm probably just doing something dumb. But hopefully there's some room for improvement.
I wanted to do something very simple, to get
(features)
out of gosh (for chibi snow).This does not work (no output, not even an error)
This does
However, that one does not work in Sagittarius while the first one does :( And I was hoping for something more or less portable, but I guess I'm running into some corner here.
A few more experiments, multiple '-e' does not work either:
I'm guessing they are evaluated in two separate environments. There may be merits in that, so let's try import libraries from command line option
-u scheme.base
does work. But it feels more Gauche-y and less r7rs-y.I was thinking of falling back to gauche mode, but I don't know where
(features)
was from and had to import scheme.base anywayGranted r7rs with all the explicit imports are not great for one-liners. And this is not a real report, just something I stumble upon. I'll probably close this soon.