I've noticed that, in my code, I've been using the names "hash-code" and "java.lang.System:identity-hash-code". So, I replaced them with "hashCode" and "identityHashCode", respectively - because it would make sense that the hash function wasn't properly overridden. But that didn't help: everything is exactly the same. It also puzzles me: why, instead of actually calling java.lang.System's static method, the methods of gnu.list.AbstractSequence are being called? (The line numbers seem to match, but the top of the stack trace is a mystery) sob., 22 paź 2022, 14:08 użytkownik Panicz Maciej Godek < godek.maciek@gmail.com> napisał: > It perhaps might have something to do with the fact, that I override the > "cons" operator with my own one, which uses eq? as equals, and Java's > default hash functions for objects: > > > > https://github.com/panicz/grasp-android/blob/master/stages/retreat/GRASP/src/primitive.scm#L151 > > sob., 22 paź 2022, 11:31 użytkownik Panicz Maciej Godek < > godek.maciek@gmail.com> napisał: > >> This is weird. >> Without the patch, the only complaint concerns the identifiers - and if I >> rename them to legal Java identifiers, everything works fine. >> >> However, when I apply the patch and try to run the editor, I get the >> following: >> >> java.lang.RuntimeException: wrong number of indexes 0 to 1-rank array >> at >> gnu.lists.AbstractSequence.badRank(AbstractSequence.java:55) >> at gnu.lists.AbstractSequence.checkRank(AbstractSequence.java:51) >> at >> gnu.lists.AbstractSequence.effectiveIndex(AbstractSequence.java:84) >> at gnu.lists.AbstractSequence.getInt(AbstractSequence.java:173) >> at cons.hashCode(primitive.scm:156) >> at >> java.base/java.util.WeakHashMap.hash(WeakHashMap.java:303) >> at java.base/java.util.WeakHashMap.getEntry(WeakHashMap.java:432) >> at >> java.base/java.util.WeakHashMap.containsKey(WeakHashMap.java:423) >> at hash$Mntable.hashRef$Pl$V(hash-table.scm:21) >> at hash$Mntable.hashRef$Pl$check(hash-table.scm:20) >> at >> gnu.mapping.CallContext.runUntilValue(CallContext.java:656) >> at gnu.mapping.Procedure.apply3(Procedure.java:167) >> at space.getter$2(space.scm:504) >> at space.getter$2$check(space.scm:504) >> at >> gnu.mapping.CallContext.runUntilValue(CallContext.java:656) >> at gnu.mapping.Procedure.apply1(Procedure.java:154) >> at >> gnu.kawa.functions.ApplyToArgs.apply2(ApplyToArgs.java:52) >> at parse$frame1.lambda5addElement$Ex(parse.scm:183) >> at parse.readList(parse.scm:275) >> at parse.readList(parse.scm) >> at >> parse.readList(parse.scm:223) >> at parse.readList(parse.scm) >> at parse.readList$check(parse.scm:165) >> at >> gnu.mapping.CallContext.runUntilValue(CallContext.java:656) >> at gnu.mapping.Procedure.apply0(Procedure.java:148) >> at parse.parseDocument(parse.scm:291) >> at parse.parseDocument(parse.scm:289) >> at >> parse.parseDocument$check(parse.scm:288) >> at >> gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75) >> at >> gnu.kawa.functions.ApplyToArgs.applyToConsumerA2A(ApplyToArgs.java:132) >> at gnu.mapping.CallContext.runUntilDone(CallContext.java:586) >> at >> gnu.mapping.CallContext.runUntilValue(CallContext.java:669) >> at gnu.mapping.Procedure.apply1(Procedure.java:154) >> at conversions$frame0.lambda2(conversions.scm:14) >> at >> conversions$frame0.lambda2$check(conversions.scm:12) >> at gnu.mapping.CallContext.runUntilValue(CallContext.java:656) >> at gnu.mapping.Procedure.apply1(Procedure.java:154) >> at >> kawa.lib.ports.callWithInputString(ports.scm:154) >> at conversions.withInputFromString(conversions.scm:12) >> at >> conversions.withInputFromString$check(conversions.scm:10) >> at gnu.mapping.CallContext.runUntilValue(CallContext.java:656) >> at gnu.mapping.Procedure.apply2(Procedure.java:160) >> at >> atInteractiveLevel$Mn3.run(primitive-terminal-client.scm:48) >> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290) >> at kawa.Shell.run(Shell.java:300) >> at kawa.Shell.runFile(Shell.java:562) >> at >> kawa.Shell.runFileOrClass(Shell.java:485) >> at kawa.repl.processArgs(repl.java:298) >> at kawa.repl.main(repl.java:830) >> >> The exception clearly comes from my code. It's a bit convoluted to >> explain what's going in there, but if you'd like to take a glimpse, you can >> find it here: >> >> >> https://github.com/panicz/grasp-android/tree/master/stages/retreat/GRASP/src >> >> Android isn't required to run any of these. You can either try running >> ./grasp-terminal (in vt100-compatible terminal with unicode) >> ./grasp-desktop (with AWT) >> or >> ./primitive-terminal-client (in terminal) >> >> >> sob., 22 paź 2022, 08:26 użytkownik Per Bothner >> napisał: >> >>> >>> >>> On 10/21/22 12:45, Panicz Maciej Godek wrote: >>> > During its compilation, Kawa issues the following warning: >>> > >>> > subclass-refering-to-mangled-superclass-property.scm:6:4: warning - no >>> declaration seen for mangled-name >>> >>> The attached patch seems to fix it. >>> >>> -- >>> --Per Bothner >>> per@bothner.com http://per.bothner.com/ >> >>