From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [IPv6:2a01:e0c:1:1599::15]) by sourceware.org (Postfix) with ESMTPS id 74576385842C for ; Tue, 14 Sep 2021 16:58:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 74576385842C Received: from smtpclient.apple (unknown [IPv6:2a01:e34:ec46:c6d0:bdb0:201f:88b4:3a38]) (Authenticated sender: phiroc@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 807EB7802C5; Tue, 14 Sep 2021 18:58:45 +0200 (CEST) From: Philippe de Rochambeau Mime-Version: 1.0 (1.0) Subject: Re: define-syntax can only be used with local variables Date: Tue, 14 Sep 2021 18:58:45 +0200 Message-Id: <9F370B42-487E-476E-B161-7C75CC461AF8@free.fr> References: <6f24aba1-97fd-eba9-2eb4-b2bae8d87a72@oca.eu> Cc: Damien Mattei , Jean-Paul Roy , kawa@sourceware.org In-Reply-To: <6f24aba1-97fd-eba9-2eb4-b2bae8d87a72@oca.eu> To: Damien.MATTEI@univ-cotedazur.fr X-Mailer: iPad Mail (18G82) X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, KAM_LOTSOFHASH, KAM_SHORT, MIME_QP_LONG_LINE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 16:58:57 -0000 Hi Damien, I=E2=80=99ll test it on Windows tomorrow on a different computer and let you= know. Cheers, Philippe PS are you a Kawa developer? > Le 14 sept. 2021 =C3=A0 18:34, Damien Mattei a =C3=A9= crit : >=20 > =EF=BB=BFi made my test on linux with a 2.0 or 2.1 version, testing on mac= os x i have the same error you have. >=20 > I installed it with brew: >=20 > mattei@macbook-pro-touch-bar ~ % brew install kawa > Updating Homebrew... > =3D=3D> Auto-updated Homebrew! > Updated 1 tap (homebrew/core). > =3D=3D> New Formulae > abricate cargo-outdated fastq-tools locust = reproc > age chrpath flamebearer microsocks = rollup > airspyhf cilium-cli fst mimalloc = sail > alembic cosign ghostunnel mrbayes = selene > ansilove cppzmq go@1.16 msgpack-cxx = singularity > artillery cruft h2c murex = solana > atop cue htmlq nanoflann spirv-llvm= -translator > basis_universal datree jpdfbookmarks newrelic-infra-ag= ent spot > bat-extras dotbot kn osc-cli = uftrace > bbtools drill libaec ots = vespa-cli > bioperl eigenpy libmng pari-galdata = vite > bubblewrap esbuild librespot pari-galpol = vue-cli > cargo-bloat f2 librist pari-seadata = yt-dlp > cargo-llvm-lines fann lit pari-seadata-big > =3D=3D> Updated Formulae > Updated 2158 formulae. > =3D=3D> Renamed Formulae > kafkacat -> kcat > =3D=3D> Deleted Formulae > boost@1.57 boost@1.60 procyon-decompiler >=20 > =3D=3D> Downloading https://ghcr.io/v2/homebrew/core/openjdk/manifests/16.= 0.2 > ######################################################################## 1= 00.0% > =3D=3D> Downloading https://ghcr.io/v2/homebrew/core/openjdk/blobs/sha256:= 83b39e22b91173ee797b09e11bbcb08b3cff5c3aeed65f64cb5f8c4 > =3D=3D> Downloading from https://pkg-containers.githubusercontent.com/ghcr= 1/blobs/sha256:83b39e22b91173ee797b09e11bbcb08b3cff5c3a > ######################################################################## 1= 00.0% > =3D=3D> Downloading https://ghcr.io/v2/homebrew/core/kawa/manifests/3.1.1_= 1 > ######################################################################## 1= 00.0% > =3D=3D> Downloading https://ghcr.io/v2/homebrew/core/kawa/blobs/sha256:483= 2b73db70b9b1c74289522820b9ba04c2eab1bf03285e4bfdfc76962 > =3D=3D> Downloading from https://pkg-containers.githubusercontent.com/ghcr= 1/blobs/sha256:4832b73db70b9b1c74289522820b9ba04c2eab1b > ######################################################################## 1= 00.0% > =3D=3D> Installing dependencies for kawa: openjdk > =3D=3D> Installing kawa dependency: openjdk > =3D=3D> Pouring openjdk--16.0.2.arm64_big_sur.bottle.tar.gz > =F0=9F=8D=BA /opt/homebrew/Cellar/openjdk/16.0.2: 643 files, 281.5MB > =3D=3D> Installing kawa > =3D=3D> Pouring kawa--3.1.1_1.all.bottle.tar.gz > =F0=9F=8D=BA /opt/homebrew/Cellar/kawa/3.1.1_1: 12 files, 5MB > =3D=3D> `brew cleanup` has not been run in the last 30 days, running now..= . > Removing: /Users/mattei/Library/Caches/Homebrew/m4--1.4.18... (228.4KB) > Removing: /Users/mattei/Library/Logs/Homebrew/pkg-config... (64B) > Removing: /Users/mattei/Library/Logs/Homebrew/libtool... (64B) > Removing: /Users/mattei/Library/Logs/Homebrew/gmp... (64B) > Removing: /Users/mattei/Library/Logs/Homebrew/libunistring... (64B) > Removing: /Users/mattei/Library/Logs/Homebrew/bdw-gc... (64B) > Removing: /Users/mattei/Library/Logs/Homebrew/readline... (64B) > Removing: /Users/mattei/Library/Logs/Homebrew/m4... (64B) > Removing: /Users/mattei/Library/Logs/Homebrew/guile... (64B) > Removing: /Users/mattei/Library/Logs/Homebrew/libffi... (64B) > mattei@macbook-pro-touch-bar ~ % kawa >=20 > #|kawa:1|# (define-syntax nil2! > #|.....2|# (syntax-rules () > #|.....3|# ((_ x) > #|.....4|# (set! x '(0))))) > #|kawa:5|# (define y '(1)) > #|kawa:6|# (nil2! y) > #|kawa:7|# y > (1) >=20 > with this problem i would made some test with an install from source if yo= u can and on other platform to see if it is a mac os x special problem or a= bug in the source code. >=20 > Damien >=20 >> Le 14/09/2021 =C3=A0 18:14, Philippe de Rochambeau via Kawa a =C3=A9crit := >> I get (1) : >>=20 >> (define-syntax nil2! >> (syntax-rules () >> ((_ x) >> (set! x '(0))))) >>=20 >>=20 >> #|kawa:1|# (load "define2.scm") >> #|kawa:2|# (define y '(1)) >> #|kawa:3|# y >> (1) >> #|kawa:4|# (nil2! y) >> #|kawa:5|# y >> (1) >> #|kawa:6|# >>=20 >> I am using Kawa 3.1.1 on Macosx. >>=20 >> Philippe >>=20 >>=20 >>>> Le 14 sept. 2021 =C3=A0 14:42, Damien Mattei a= =C3=A9crit : >>>=20 >>> i have test one of your example and it works fine on my system: >>> mattei@moita ~]$ kawa >>> #|kawa:1|# (define-syntax nil2! >>> (syntax-rules () >>> ((_ x) >>> (set! x '(0))))) >>> #|(---:2|# #|(---:3|# #|(---:4|# #|kawa:5|# >>> #|kawa:6|# (define y '(1)) >>> (nil2! y) >>> (display y) (newline)#|kawa:7|# #|kawa:8|# >>> (0) >>> #|kawa:9|# y >>> (0) >>>=20 >>> Damien >>>=20 >>>> On Fri, Sep 10, 2021 at 9:34 AM phiroc--- via Kawa > wrote: >>> Hello, >>> in the below code, nil! and nil2! only set variables values to '() and '= (0) when such variables are local (let). >>> When I run the code with LispKit Go Scheme, global variables (such as y b= elow) are also set. >>> What gives? >>> Many thanks. >>> Philippe >>>=20 >>>=20 >>>=20 >>> ;; >>> ;; ..\bin\kawa -C .\javafx0.scm >>> ;; java -cp "..\lib\kawa.jar;." javafx0 >>>=20 >>> (let ((x '(1 2 3))) >>> (define-syntax nil! >>> (syntax-rules () >>> ((_ x) >>> (set! x '())))) >>> (nil! x) (newline) (display x) (newline)) >>>=20 >>> (define-syntax nil2! >>> (syntax-rules () >>> ((_ x) >>> (set! x '(0))))) >>>=20 >>> (let ((x2 '(4 5 6))) >>> (nil2! x2) >>> (display x2) (newline)) >>>=20 >>> (define y '(1)) >>> (nil2! y) >>> (display y) (newline) >>>=20 >>> (define (f-nil! x) >>> (set! x '())) >>>=20 >>> (define z 4) >>> (f-nil! z) >>> (display z)