public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: 伊藤一光 <kaz.mitu.ito@gmail.com>, kawa@sourceware.org
Subject: Re: The command line option --script
Date: Wed, 3 Jan 2024 21:46:43 -0800	[thread overview]
Message-ID: <8e900592-ac9b-4e91-96ad-20d601ce6e71@bothner.com> (raw)
In-Reply-To: <CALJPn-w88pdiGjDseHsUvj+=9wk2eTkOL=8WvOPvf5U2T6ftYg@mail.gmail.com>



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/

      reply	other threads:[~2024-01-04  5:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04  3:16 伊藤一光
2024-01-04  5:46 ` Per Bothner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e900592-ac9b-4e91-96ad-20d601ce6e71@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=kaz.mitu.ito@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).