From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by sourceware.org (Postfix) with ESMTPS id D23B0389901D for ; Mon, 1 Jul 2024 08:54:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D23B0389901D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D23B0389901D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::733 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719824075; cv=none; b=L3Nvc4dhZDqEQLs0Fi6Vcfqg4BUq1wv7RCBp1PlbOU1QwfWJV9DOBUeBt2Hsh/cPwk/gAZ8ofEdrmC8sMeBKC6Uh61ttYSpHHNBS7sSBIBD5QE3nbxmASLD/9UO9sFk0T8KSWiDK6xzWRkC+FJW6Hby2P/10LfhtqZg+xooXoRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719824075; c=relaxed/simple; bh=vM9Obju68ghdeBqhltwLydq4Y0/62tUkXtU5RNeO8mk=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=RzYNzgjpr7W552Omp8eKYFvaOj3RvJMa6i0QFX5PdMW1Vjy/yx4u+1Wu0jsJ1/Mq7wAGEeZw9GaXsEg5e208tTMqIuZEURjy09jQrkGxewzkKiSzjqrV+5i/NeNzkxGO78lnpgj1wKDset452NeH6B7gQu06rgsJ+pNAlnT9+1E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-79d5e616e34so204486485a.2 for ; Mon, 01 Jul 2024 01:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719824069; x=1720428869; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=muZ23GiPPoRRAExGVOUfek95CO9JfgdB5WzB9JdrqhQ=; b=iyIwzTiqjSD/zPKiQyH/lijSqEsw7T4XoH4f3h9QMTB0khNAQkZi9GRY4mMvEoBEPK 2H4HsnBg3r9xEV/Nu5sZNoyuhtOIOHntmZNl4TVMcmbxeWujDBENWX0Q4+zZ45+ckUTk Pt7NmB/X2y8qtcTHiB7Nm3B2Q2CVhA0QfehMYwkMlDeYe+uU8pYhcSskqNxeZ0X8nA+q Y0JS+cv9KH6saQG77jFAThqVhcJ2LPobFUbgDgE7XA4LSHMZs+d8sjkMweWOuZPlEcCX OHsRQ1WhxebDmhTtAgpF2IcI5yGlY4ax24Ee3vQ+IK8+YZRLZemcLhsPjJJ3zTkehVmI NaSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719824069; x=1720428869; 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=muZ23GiPPoRRAExGVOUfek95CO9JfgdB5WzB9JdrqhQ=; b=PCYWBVtp3kOIRL+nAgLqMB/SVFrxpKzuAg3lXKTZEIGN+Vdf1UHvzPlubKolL90dvu w942lsgzoJ7ZmOuYzrJpGayffkQFDY/bDDo+fGy+NWBX5vengE+/1yiNRKJONVbEcWg9 l4mi5xkksAG/wdHKIK6CIaNxGNI4QlzGoBs7oL+QVyH/jI5xUtzEDFZ+R0EZBOAdTz3G Pva1676uCk7LeA0sXHhy610xxZ3tTXPiiQCmTPTdWOr5IP/mHo2mFJSvVPH9VftKP43b XjLX/O0SW7xtKwg2KQ9IcbgIEGG4pKUw+H2+VRJbKx+WL8qbQZywx+tVfTPqSeUFXXfD hzKw== X-Gm-Message-State: AOJu0Yz/B4Eq76ZVS08paEBxo3WTQjZi+rnc6LxP+3mV/i56pSAKtZWH 2IcNSJB63ob0+I54hiKlI4aye6PUsk2Sc7lM2qk/9O2Y1qxoMm5g41JYhJulP1sqMw7bi3pcmXN Rr8gBgh85/6/sne0Z99o9mNsXlNAHhA== X-Google-Smtp-Source: AGHT+IHVes0IAzeYMAwgn0P0vSPul/soor+opi1bTp/o3hTRNEcYEPJQjj3Q+gGarJKaWfjKwID6AvlojkfMoE3NdhM= X-Received: by 2002:a05:620a:2688:b0:79d:5c9e:f7b9 with SMTP id af79cd13be357-79d7b9b0eefmr674734185a.14.1719824068938; Mon, 01 Jul 2024 01:54:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Damien Mattei Date: Mon, 1 Jul 2024 10:54:17 +0200 Message-ID: Subject: Re: bug in kawa syntax transformer? To: Per Bothner Cc: kawa mailing list Content-Type: multipart/alternative; boundary="000000000000b49277061c2bbe02" X-Spam-Status: No, score=-0.3 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: --000000000000b49277061c2bbe02 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable i find a good rule with syntax-transformers, no matter r7rs or not... you can use them in modules but when comes the time to start the whole program at REPL use (load "program.scm") instead of (import (program)) or (require program) so when there is some syntax-transformers do not start your program by (define-library (program) ... or even (module-name program) but simply put the code, and even your program is also considered as a module as any file.scm in Kawa is considered as a module file. but i'm still searching more on this problem.... On Sat, Jun 29, 2024 at 5:32=E2=80=AFPM Damien Mattei wrote: > i find a way to make it run, i wanted to post the answer later.... > > it works now. > > in summary the solution is: > > for a module test-foo that use module foo you have to: > > be at REPL and: > > (import (foo)) > > (import (test-foo)) > > and it is ok. > > but it is not the normal behavior , because as foo is already imported by > test-foo the module should works without also importing foo in REPL > > example: > > test-nfx.scm: > > (define-library (test-nfx) ; R7RS > > (import > (kawa base) > > (operators-list) > (n-arity) > (infix-with-precedence-to-prefix) > (nfx)) > > > (define x ($nfx$ 3 * 5 + 2)) > (display x) (newline) > > ) > > #|kawa:1|# (import (nfx)) > #|kawa:2|# ($nfx$ 3 * 5 + 2) > 17 > #|kawa:3|# (import (test-nfx)) > 17 > > > another example: > > #|kawa:1|# (import (Scheme+)) > #|kawa:2|# > #|kawa:3|# (bracket-apply #(1 2 3 4 5) 2) > bracket-apply : #'parsed-args=3D(# 2) > (bracket-apply #(1 2 3 4 5) 2) > 3 > #|kawa:4|# ($nfx$ 3 * 5 + 2) > 17 > #|kawa:5|# (exit) > > for a whole program that use Scheme+: > > #|kawa:1|# (import (Scheme+)) > > #|kawa:2|# (load > "exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm") > > ################## NOT ################## > *init* : nc=3D#(1 2 1) > z=3D#(#(0) #(0 0) #(0)) > z=CC=83=3D#(#(0) #(0 0) #(0)) > define-overload-existing-operator : proc =3D# > define-overload-existing-operator : orig-proc =3D# > M=3D#(matrix@3811464b matrix@5f0a5848) > =E1=90=81=3D#(#(0) #(0 0) #(0)) > nbiter=3D5000 > exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm:145:2: > warning - no known slot 'apprentissage' in java.lang.Object > 0 > 1000 > 2000 > 3000 > 4000 > exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm:147:2: > warning - no known slot 'test' in java.lang.Object > Test des exemples : > #(1) --> #(0.005218051056863006) : on attendait #(0) > #(0) --> #(0.9937685906977904) : on attendait #(1) > Error on examples=3D3.3029259361846465E-5 > > ################## XOR ################## > *init* : nc=3D#(2 8 1) > z=3D#(#(0 0) #(0 0 0 0 0 0 0 0) #(0)) > z=CC=83=3D#(#(0 0) #(0 0 0 0 0 0 0 0) #(0)) > M=3D#(matrix@7fb313e3 matrix@771ede0d) > =E1=90=81=3D#(#(0 0) #(0 0 0 0 0 0 0 0) #(0)) > nbiter=3D250000 > exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm:160:2: > warning - no known slot 'apprentissage' in java.lang.Object > exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm:162:2: > warning - no known slot 'test' in java.lang.Object > Test des exemples : > #(1 0) --> #(0.9869979600720541) : on attendait #(1) > #(0 0) --> #(0.009586857552488845) : on attendait #(0) > #(0 1) --> #(0.9875938547018659) : on attendait #(1) > #(1 1) --> #(0.015785460599146515) : on attendait #(0) > Error on examples=3D3.32027043752617E-4 > > ################## SINE ################## > *init* : nc=3D#(1 70 70 1) > > but perheaps there is a solution with playing with import/require, > Kawa/R7RS i will test any possible combinaison (? do not know the english > term) > > the problem only happen with syntax transformer, if not , i would have > noticed already......or someone else.... > > Damien > > On Sat, Jun 29, 2024 at 4:17=E2=80=AFPM Per Bothner wro= te: > >> Perhaps - or perhaps it depends on unspecified behavior. >> >> In any case, I think you're going to have to debug this on your own. >> >> On 6/29/24 2:03 AM, Damien Mattei via Kawa wrote: >> > i'm sure it is a kawa bug because i ported all the code to Guile and it >> > works perfectly. >> >> -- >> --Per Bothner >> per@bothner.com http://per.bothner.com/ >> > --000000000000b49277061c2bbe02--