* Re: The command line option --script
2024-01-04 3:16 The command line option --script 伊藤一光
@ 2024-01-04 5:46 ` Per Bothner
0 siblings, 0 replies; 2+ messages in thread
From: Per Bothner @ 2024-01-04 5:46 UTC (permalink / raw)
To: 伊藤一光, kawa
On 1/3/24 19:16, 伊藤一光 via Kawa wrote:
> I remember reading some explanation about the command line option
> "--script", but I do not fully understand it.
Yes, the Kawa documentation doesn't explain this properly.
Basically, the difference is that --script causes the file to be
processed line-by-line. This means that the Kawa evaluates each line in order.
A "line" in this context is the minimum non-zero number of complete lines
that comprise a balanced S-expressions (list) or until a reader error occurs.
That line is read, macro-expanded, analyzed, compiled, and evaluated,
before the following line is processed. Each "line" treated as a separate "module".
This is in contrast to the default whole-file mode, where the whole file is read;
all of the resulting S-expressions are macro-expanded, analyzed, and compiled
to a single "module". Only after the whole file has been compiled, then the
whole module is evaluated.
That doesn't explain the error you're seeing, which is because of the
kludge starting at line 73 in kawa/standard/set_b.java. And that in turn
was to fix this issue: https://gitlab.com/kashell/Kawa/-/issues/44
This is a Kawa bug, but it isn't obvious how to fix it. The clean/simple
way would probably be to remove the "kludge" in set_b.java. However,
that would presumably re-introduce the issue #44. On the other hand,
trace and untrace are a big kludge that don't go very well with the
compiler-based model of what Kawa is about, so perhaps we should just
give up on them - they only work in limited cases, anyway.
I don't know what the right solution is - and I don't want to spend
a lot of time on it.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 2+ messages in thread