Ok, I've tried Qi II...
I found out the problem with the readtable case:
ABCL uses an ad-hoc readtable for loading compiled code ("fasl"
files). These files consist partly of textual Lisp forms, partly of
binary files for compiled functions. So the textual code when read
back is read with default readtable settings, including :upcase
behavior, even if some symbols to be read are not uppercase.
To circumvent the problem, I changed the fasl readtable to have a
default case of :preserve instead of :upcase. This fixes the issue
with Qi and should not give other problems, since this readtable is
only used to read back printed Lisp code, which has already the
However, probably the optimal solution would be to both write and read
the fasl code with default i/o settings, since case is not the only
possible source of confusion: *print-base* comes to my mind, for
Qi II has still the other issue Qi had: the Qi REPL is run in package
:cl-user instead of :qi. However, I launch the REPL myself with
(qi::qi) since I have no saved image, so maybe I'm missing the fact
that the qi function expects to be called when *package* is already
Apart from that, things seems to run fine. I've only tried some
snippets from the 15-min tutorial though. If you have some test suite
to verify Qi is functioning properly, let me know.
On Mon, Jun 1, 2009 at 11:06 AM, Alessio Stalla <alessiostalla@...> wrote:
> Oh, sorry, you're right! I downloaded it from the Google Code page,
> and I didn't look at the lambda associates page... well, it helped
> uncover a bug in abcl, so, it wasn't completely wasted time :)
> Now, on to Qi II...
> On Mon, Jun 1, 2009 at 2:10 AM, Mark Tarver <dr.mtarver@...> wrote:
>> You're running a very old Qi there. Qi I; Qi II is the one to use. Actually
>> in Qi II ; is not redefined by SET-SYNTAX..,
>> though the readtable is made case preserving.
>> ----- Original Message ----- From: "Alessio Stalla"
>> To: <dr.mtarver@...>
>> Cc: <armedbear-j-devel@...>
>> Sent: Sunday, May 31, 2009 1:37 PM
>> Subject: Qi on ABCL
>>> Hello Mark,
>>> as promised, I made a quick attempt at running Qi on ABCL. I'm CC'ing
>>> the ABCL mailing list.
>>> I've gotten Qi to load (but only interpreted, see below), just making
>>> trivial modifications to "Qi 9.2.txt" (basically just adding a few
>>> read-time conditionals for ABCL). If I understood it correctly this is
>>> not Qi's source but is rather auto-generated from another file,
>>> however I don't know how to do the generation myself, so I directly
>>> modified the end product - it should be easy to backport my little
>>> fixes to the source.
>>> However, Qi is not working properly. (qi::qi) gives me the Qi REPL: if
>>> I type simple expressions at the REPL, like (and true false), it gives
>>> me errors about undefined functions (e.g. and in the case before). I
>>> initially thought it was the thing you mentioned - the readtable
>>> behavior reverting to upcase somewhere - since for non-alphabetic
>>> functions, like mathematical operators, things work smoothly. However,
>>> evaluting this:
>>> (READTABLE-CASE (EVAL *READTABLE*))
>>> returns :PRESERVE, so it seems the readtable is set up ok while Qi is
>>> running. Then I investigated a little bit more and discovered it's
>>> actually a package problem: prefixing all symbols with qi: works. In
>>> fact, (EVAL *PACKAGE*) ==> #<PACKAGE "COMMON-LISP-USER">
>>> I don't know how to fix this, but maybe you can point me to the right
>>> I've also seen test suites in the Qi directory but I don't know how to
>>> run them (should I just load them?).
>>> Instead, regarding compilation:
>>> 1. I spotted a bug in ABCL that prevented it to correctly compiling
>>> files with a space in their name (the generated Java class contained
>>> the space in its name and this is not valid).
>>> 2. ABCL's compiled files usually (always?) have a textual prologue
>>> with a few Lisp forms that load the actual code. This textual prologue
>>> starts with a commented Emacs mode-line. Since Qi redefines ; to be a
>>> regular character, ABCL chokes when loading Qi interpreted (which
>>> changes the meaning of ;) and then Qi compiled. I temporarily
>>> commented out the code writing the mode-line in my copy of ABCL.
>>> 3. After fixing 1. and 2., loading the compiled file works up to a
>>> certain point, then it basically crashes without much explanation
>>> ("maximum error depth exceeded"??). However, while loading it
>>> complains about the redefinition of many Common Lisp operators, so
>>> maybe the problem is related to packages just like in the interpreted
>>> In summary, we could be a little step away from Qi working on ABCL, if
>>> it all amounts to an incorrect handling of packages. Yes, I'm being
>>> too optimistic today :)