This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: GSOC | Extending Common Lisp support
On Jun 20, 2012, at 11:44 AM, Charles Turner wrote:
I get a VerifyError when I try to use the DO form in CL. The same
behaviour can be observed from the kawa-1.12 release jar.
#|kawa:1|# (do ((temp-one 1 (+ 1 temp-one))
(temp-two 0 (- temp-two 1)))
((> (- temp-one temp-two) 5) temp-one))
/dev/stdin:1:1: warning - no declaration seen for %do-lambda1
[ ... bunch of undefined variable errors ...]
exception while initializing module atInteractiveLevel$1
at gnu.expr.ModuleContext.findInstance(ModuleContext.java:84)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:289)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:200)
at kawa.Shell.run(Shell.java:279)
at kawa.Shell.run(Shell.java:194)
at kawa.Shell.run(Shell.java:175)
at kawa.repl.main(repl.java:891)
Caused by: java.lang.VerifyError: (class: atInteractiveLevel$1,
method: run signature: (Lgnu/mapping/CallContext;)V) Accessing value
from uninitialized register 3
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
at java.lang.Class.getDeclaredField(Class.java:1897)
at gnu.expr.ModuleContext.findInstance(ModuleContext.java:74)
... 6 more
The "no declaration seen for %do-lambda1" is perplexing, as it's
definitely being loaded in the CL startup. It's interesting to note
that evaluating "do" in Scheme causes the std_syntax.scm file to be
evaluated once, but subsequent evals of "do" do not cause this. This
behaviour is not seen when evaluating "#'do" in CL. Not sure if this
is a useful data point or not.
I see the same thing with case and "no declaration seen for %case":
$ kawa --lisp
#|kawa:1|# (case 'f ((a e i o u) 'vowel) (else 'consonant))
/dev/stdin:1:1: warning - no declaration seen for %case
/dev/stdin:1:11: warning - no declaration seen for a
/dev/stdin:1:14: warning - no declaration seen for e
/dev/stdin:1:16: warning - no declaration seen for i
/dev/stdin:1:18: warning - no declaration seen for o
/dev/stdin:1:20: warning - no declaration seen for u
/dev/stdin:1:31: warning - no declaration seen for else
/dev/stdin:1:1: unbound location %case (property (function))
at gnu.mapping.Location.get(Location.java:67)
at atInteractiveLevel$1.run(stdin:1)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:299)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:200)
at kawa.Shell.run(Shell.java:279)
at kawa.Shell.run(Shell.java:194)
at kawa.Shell.run(Shell.java:175)
at kawa.repl.main(repl.java:891)
It has something to do with referencing a macro which isn't
module-exported. If I add %case and %case-match to the list at the
top of std_syntax.scm, then it works:
$ kawa --lisp
#|kawa:1|# (case 'f ((a e i o u) 'vowel) (else 'consonant))
vowel
Likewise for do, if I add %do-lambda1, %do-lambda2, %do-step, and
%do-init:
$ kawa --lisp
#|kawa:1|# (do ((temp-one 1 (+ 1 temp-one)) (temp-two 0 (- temp-two
1))) ((> (- temp-one temp-two) 5) temp-one))
1
The solution has so far failed to jump out at me.
--
Jamison Hope
The PTR Group
www.theptrgroup.com