public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Philippe de Rochambeau <phiroc@free.fr>
To: Damien.MATTEI@univ-cotedazur.fr
Cc: Damien Mattei <damien.mattei@gmail.com>,
	Jean-Paul Roy <jean-paul.roy@unice.fr>,
	kawa@sourceware.org
Subject: Re: define-syntax can only be used with local variables
Date: Tue, 14 Sep 2021 18:58:45 +0200	[thread overview]
Message-ID: <9F370B42-487E-476E-B161-7C75CC461AF8@free.fr> (raw)
In-Reply-To: <6f24aba1-97fd-eba9-2eb4-b2bae8d87a72@oca.eu>

Hi Damien,
I’ll 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 à 18:34, Damien Mattei <damien.mattei@oca.eu> a écrit :
> 
> i 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.
> 
> I installed it with brew:
> 
> mattei@macbook-pro-touch-bar ~ % brew install kawa
> Updating Homebrew...
> ==> Auto-updated Homebrew!
> Updated 1 tap (homebrew/core).
> ==> 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-agent     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
> ==> Updated Formulae
> Updated 2158 formulae.
> ==> Renamed Formulae
> kafkacat -> kcat
> ==> Deleted Formulae
> boost@1.57 boost@1.60                                procyon-decompiler
> 
> ==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/manifests/16.0.2
> ######################################################################## 100.0%
> ==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/blobs/sha256:83b39e22b91173ee797b09e11bbcb08b3cff5c3aeed65f64cb5f8c4
> ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:83b39e22b91173ee797b09e11bbcb08b3cff5c3a
> ######################################################################## 100.0%
> ==> Downloading https://ghcr.io/v2/homebrew/core/kawa/manifests/3.1.1_1
> ######################################################################## 100.0%
> ==> Downloading https://ghcr.io/v2/homebrew/core/kawa/blobs/sha256:4832b73db70b9b1c74289522820b9ba04c2eab1bf03285e4bfdfc76962
> ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:4832b73db70b9b1c74289522820b9ba04c2eab1b
> ######################################################################## 100.0%
> ==> Installing dependencies for kawa: openjdk
> ==> Installing kawa dependency: openjdk
> ==> Pouring openjdk--16.0.2.arm64_big_sur.bottle.tar.gz
> 🍺  /opt/homebrew/Cellar/openjdk/16.0.2: 643 files, 281.5MB
> ==> Installing kawa
> ==> Pouring kawa--3.1.1_1.all.bottle.tar.gz
> 🍺  /opt/homebrew/Cellar/kawa/3.1.1_1: 12 files, 5MB
> ==> `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
> 
> #|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)
> 
> with this problem i would made some test with an install from source if you can and on other platform to see if it is a mac os x special  problem or a bug in the source code.
> 
> Damien
> 
>> Le 14/09/2021 à 18:14, Philippe de Rochambeau via Kawa a écrit :
>> I get (1) :
>> 
>> (define-syntax nil2!
>>     (syntax-rules ()
>>         ((_ x)
>>             (set! x '(0)))))
>> 
>> 
>> #|kawa:1|# (load "define2.scm")
>> #|kawa:2|# (define y '(1))
>> #|kawa:3|# y
>> (1)
>> #|kawa:4|# (nil2! y)
>> #|kawa:5|# y
>> (1)
>> #|kawa:6|#
>> 
>> I am using Kawa 3.1.1 on Macosx.
>> 
>> Philippe
>> 
>> 
>>>> Le 14 sept. 2021 à 14:42, Damien Mattei <damien.mattei@gmail.com> a écrit :
>>> 
>>> 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)
>>> 
>>> Damien
>>> 
>>>> On Fri, Sep 10, 2021 at 9:34 AM phiroc--- via Kawa <kawa@sourceware.org <mailto:kawa@sourceware.org>> 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 below) are also set.
>>> What gives?
>>> Many thanks.
>>> Philippe
>>> 
>>> 
>>> 
>>> ;;
>>> ;; ..\bin\kawa -C .\javafx0.scm
>>> ;; java -cp "..\lib\kawa.jar;." javafx0
>>> 
>>> (let ((x '(1 2 3)))
>>>     (define-syntax nil!
>>>         (syntax-rules ()
>>>             ((_ x)
>>>                 (set! x '()))))
>>>         (nil! x) (newline) (display x) (newline))
>>> 
>>> (define-syntax nil2!
>>>     (syntax-rules ()
>>>         ((_ x)
>>>             (set! x '(0)))))
>>> 
>>> (let ((x2 '(4 5 6)))
>>>     (nil2! x2)
>>>     (display x2) (newline))
>>> 
>>> (define y '(1))
>>> (nil2! y)
>>> (display y) (newline)
>>> 
>>> (define (f-nil! x)
>>>     (set! x '()))
>>> 
>>> (define z 4)
>>> (f-nil! z)
>>> (display z)

  reply	other threads:[~2021-09-14 16:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <971550055.197381511.1631259004148.JavaMail.root@zimbra65-e11.priv.proxad.net>
2021-09-10  7:33 ` phiroc
2021-09-14 12:42   ` Damien Mattei
2021-09-14 16:14     ` Philippe de Rochambeau
2021-09-14 16:34       ` Damien Mattei
2021-09-14 16:58         ` Philippe de Rochambeau [this message]
2021-09-14 17:26   ` Per Bothner
2021-09-14 17:38     ` Damien Mattei
2021-09-14 17:58     ` Damien Mattei
2021-09-14 18:00       ` Damien Mattei
2021-09-14 18:07         ` Per Bothner
2021-09-14 18:38           ` Damien Mattei
2021-09-14 19:30             ` Per Bothner
2021-09-15  7:10               ` phiroc
2021-09-16 10:02                 ` phiroc
2021-09-16 10:41                   ` Damien MATTEI
2021-09-16 11:05                     ` phiroc
2021-09-16 13:44                       ` Damien MATTEI
2021-09-17  5:29                       ` Per Bothner
2021-09-17  7:00                         ` phiroc
2021-09-17 10:48                           ` Per Bothner
2021-09-16 21:11                   ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9F370B42-487E-476E-B161-7C75CC461AF8@free.fr \
    --to=phiroc@free.fr \
    --cc=Damien.MATTEI@univ-cotedazur.fr \
    --cc=damien.mattei@gmail.com \
    --cc=jean-paul.roy@unice.fr \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).