From: Adam W. <li...@co...> - 2003-06-08 14:28:59
|
Hi Sam, Bruno and all, I have located an incompatibility between files compiled in the default readtable mode and readtable invert mode. It leads to identical interpreted code having different bytecode representations that breaks loading in invert mode. The point to remember is that fully lowercase code in invert mode leads to identical list structures. Yet the bytecode switches to lowercase! Consider the code (print "Hello"). print in the source code becomes the symbol PRINT in both default and invert mode. That is the resulting list structure is (PRINT "Hello"). Yet compare this bytecode [c1.lisp and c2.lisp contains the source (print "Hello")]: c1.fas: (SYSTEM::VERSION '(20030222.)) #0Y UTF-8 #Y(#:|(PRINT "Hello")-1| #17Y(00 00 00 00 00 00 00 00 00 01 DA 38 01 31 82 19 01) (COMMON-LISP::T . COMMON-LISP::T) "Hello") c2.fas: (system::version '(20030222.)) #0Y utf-8 #Y(#:|(print "Hello")-1| #17Y(00 00 00 00 00 00 00 00 00 01 DA 38 01 31 82 19 01) (common-lisp::t . common-lisp::t) "Hello") In the second case the bytecode was compiled with (setf (readtable-case *readtable*) :invert) in effect. Bytecode compiled in the common default mode _cannot be loaded while in invert mode_: [5]> (load "c1.fas") *** - read from #<input buffered file-stream character #P"c1.fas" @1>: there is no package with name "system" Here we can see that CLISP is inverting the _uppercase_ bytecode symbols, even though they were only supposed to be inverted when reading the _original source code_! I discovered this problem with ILISP as the *.fas files were compiled when the package was upgraded in the default readtable mode. I resolved the problem by loading the uncompiled *.lisp files instead of the *.fas files. Here's another example of the problem that I earlier discussed on the ILISP mailing list: <http://article.gmane.org/gmane.lisp.ilisp.devel/348> Since then I have worked around the CLISP problem by recompiling the lisp files while in invert mode. This is not at all urgent to fix but I hope this bytecode incompatibility/incorrect loading of bytecode can be keep in mind to fix when the opportunity is right. Regards, Adam |