From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by sourceware.org (Postfix) with ESMTPS id 2AC17385802B for ; Mon, 24 Oct 2022 07:22:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2AC17385802B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe30.google.com with SMTP id q127so2172329vsa.7 for ; Mon, 24 Oct 2022 00:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GuSrM+ZI9I/AAUQ47/hHG/1bNChrv8iwxcksP6BCQIc=; b=bqTqeJJqz6/xwGVt5iPzGmC6CyK1lhurSGeIllVylWnV50ticL7PCCZqYCmrB0/mH5 sO8RluHm02cajS+NAvFAG0gIEnXeDkzonGsfzp4SE/LfdKtPcBsW3+V7hxQM6Fl2Qj9B 5nzjWJqxgDFZ32YIKYIYAfFHjuTOfrrAhVkpFPKQ9X9DA9HdMTplxhnKHM9u/9vnPBFs wQTRPOnPCb31z5D01SpH3WLruhaOScc+VsWbECt/tkJyGKwLoJOpDdgnMYjZq6DVIB6S Fsl7Of8YBH+HcpLT7AzX7tEu0/SrhpBE6SUz3ZAFyPJy465uS+BzCv+2hj2hjY/MrVd7 h98g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GuSrM+ZI9I/AAUQ47/hHG/1bNChrv8iwxcksP6BCQIc=; b=NoEtl+22PwKSt8HnB6Bf9c/OB3hfPj1T2vfePKVUJje2+jcl6ycAGCsbkoNV6Ixmsm DBpX6CcQkrvLK5PZrulW6EemDKmQhH8GsjNEIaZlAvYH2ZBuHcFSl1d4Um0gJuujrefZ qJdJJ1vk/1N5E5veSm2y816Alfr1NN1ZSYlB9EflmWzVAluAon8B8Y/qkzy15sb0E9Cu 4CobYBx8hxQWqbzZ+HRIph/8obXBCF8eBgow/Ca5cxNhfFXgjDHJJ3hl54LB7QYyMiJh JjmnQ0JIa52JAwDM+ZId5TCjOwXY0TAfLJOQEFM6DaVR8flOEl/4l8AXr924+E2pS5OZ VU6w== X-Gm-Message-State: ACrzQf07lYICSdD7K+zu2Thu19Td5BTv091hWXaU8GSfl5u17Plo74Bz Q+J1wZSuFalLc9OJ+FeLsqmVFQsL0BAK2CDWIVyL1Auo X-Google-Smtp-Source: AMsMyM5uStxU6O4GYaOb/69GqQwolh5M16Wfw6eB7GW9JHme4Ws9JR8xpul85gX/QP5+xXQaG0sMq0rkUdCKIenunl4= X-Received: by 2002:a67:fbd5:0:b0:3aa:cdc:80fc with SMTP id o21-20020a67fbd5000000b003aa0cdc80fcmr4488554vsr.31.1666596155405; Mon, 24 Oct 2022 00:22:35 -0700 (PDT) MIME-Version: 1.0 References: <0986a08f-c28f-882c-8236-f5f3ecc5cb6a@bothner.com> <3077976f-5161-3069-f540-5fb79ef95665@bothner.com> In-Reply-To: From: Panicz Maciej Godek Date: Mon, 24 Oct 2022 09:22:23 +0200 Message-ID: Subject: Re: Building for Android To: Per Bothner Cc: kawa@sourceware.org Content-Type: multipart/alternative; boundary="000000000000d3bb3d05ebc2a7c7" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000d3bb3d05ebc2a7c7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=C5=BA 2022, 14:08 u=C5=BCytkownik Panicz Maciej Godek < godek.maciek@gmail.com> napisa=C5=82: > 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=C5=BA 2022, 11:31 u=C5=BCytkownik Panicz Maciej Godek < > godek.maciek@gmail.com> napisa=C5=82: > >> 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:5= 1) >> 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:43= 2) >> 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:2= 0) >> 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:50= 4) >> 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=C5=BA 2022, 08:26 u=C5=BCytkownik Per Bothner >> napisa=C5=82: >> >>> >>> >>> 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/ >> >> --000000000000d3bb3d05ebc2a7c7--