kawa-commonlisp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Kawa-commonlisp-dev] [GSoC] Status


From: Jamison Hope
Subject: Re: [Kawa-commonlisp-dev] [GSoC] Status
Date: Thu, 9 Aug 2012 22:57:53 -0400

On Aug 9, 2012, at 6:12 PM, Charles Turner wrote:

After further testing,  I've discovered a problem with this build
procedure. The first problem is that defSntxStFld doesn't properly
export a symbol for CL:

 protected void defSntxStFld(String name, String cname, String fname)
 {
   Object property
= hasSeparateFunctionNamespace() ? EnvironmentKey.FUNCTION : null;
   StaticFieldLocation loc =
StaticFieldLocation.define(environ, environ.getSymbol(name), property,
                                 cname, fname);
   loc.setSyntax();
 }

that environ.getSymbol(name) isn't what we want for CL, right? You can
see the problem from the REPL by trying something like #'defpackage.

I first changed that to just getSymbol(name), which is overriden in
CommonLisp to first look the symbol up in the current package, and
only if that fails try the environment.getSymbol() lookup.That fixes
the problem in that #'defpackage does what it should,

Sounds OK.

but it causes a
seemingly unrelated build error for for gnu.commonlisp.lisp.defmacro:

(compiling defmacro.lisp to gnu.commonlisp.lisp.defmacro)
(+ #!null 1) ; <- from a FORMAT in the GENSYM definition.
java.lang.NullPointerException
        at gnu.kawa.functions.Arithmetic.asIntNum(Arithmetic.java:221)
        at gnu.kawa.functions.AddOp.apply2(AddOp.java:57)
        at gnu.kawa.functions.AddOp.applyN(AddOp.java:145)
        at gnu.kawa.functions.AddOp.applyN(AddOp.java:160)
        at gnu.mapping.ProcedureN.apply2(ProcedureN.java:39)
        at gnu.commonlisp.lisp.primitives.GENSYM(primitives.lisp:142)
      [ snipped ... ]
defmacro.lisp:245:3: evaluating syntax transformer 'ONCE-ONLY' threw
java.lang.NullPointerException

I don't think it's actually causing that, I think it's just that with the
other fix you're now getting far enough along in building to encounter
this other unrelated problem. I think I saw this exact error when I was
messing with things earlier (I temporarily worked around it by cheating --
catching the NPE inside of asIntNum and returning IntNum.zero() in that
case).

It looks like passing --module-static-run helps (it makes sure that
*GENSYM-COUNTER* is assigned the value 0 when the class is initialized),
but then I hit something else:

java -classpath "../../..:./../../..:$CLASSPATH" kawa.repl -d ../../.. -P `echo gnu-commonlisp-lisp|sed -e s/-/./g`. --clisp --module-static- run -C primitives.lisp defmacro.lisp
(compiling primitives.lisp to gnu.commonlisp.lisp.primitives)
primitives.lisp:163:13: warning - no declaration seen for COMMON- LISP:CL-ERROR
(compiling defmacro.lisp to gnu.commonlisp.lisp.defmacro)
(+ 0 1)
defmacro.lisp:245:3: call to 'gentemp' has too many arguments (1; must be 0)
make[2]: *** [clisp-classes.stamp] Error 255
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

That seems genuine (it's finding Scheme's gentemp which takes no
arguments).

Try adding --module-static-run to the Makefile and then retry your
defSntxStFld changes.


Not sure what in particular triggered the difference in number of
generated class files; just depends upon how many closures the
compiler decides it needs to keep around.

--
Jamison Hope
The PTR Group
www.theptrgroup.com






reply via email to

[Prev in Thread] Current Thread [Next in Thread]