From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id DE45C3858402 for ; Tue, 14 Sep 2021 17:38:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DE45C3858402 Received: by mail-il1-x133.google.com with SMTP id q14so14982322ils.5 for ; Tue, 14 Sep 2021 10:38:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pysdR6IeVcACLi7FsDzWJ4erKQ9KBToZpCKKmXsQav8=; b=j8Jnh9NeMMjNbR46+daxorcQtcCZ2froc8btliwX/Bp+JWPNm+K1WFjFb5mW7ttVt2 csZn7L93B/2zHzt0fOjXwoUg243lWm/uOPt0OOTt7HWZE1c0WNU150YmEsajkrWkII10 F/Tnm9Y7kO0aLyMSabbS09XR6+OO/HEnbNvGS3emGnZZpoNRhNKRWkcYYMPw+mnc+p/h tNfOcrq5aK+i3Bthn6LqemsNR9gf+VXqP1LkQvnbl9p2EcbqooFxtK5jjqVe6YHGbhj3 pvJ3Zx6zY21b8QhWwYqkltXZHuHwdq7gv+Chd4ONYSLCY0Ma+ZAsEY79Nh527XNhwh82 FzbA== X-Gm-Message-State: AOAM5310JgM8mVTQqkATRiked+ByV0rKKMkgUoM3KEYmQeNLnDs99wvT t0BBUKdrgjbXyz2yrUJpIFdnLFlxkUeVqbBcbQA= X-Google-Smtp-Source: ABdhPJzU2UoS8CfrDGXprNU2DjAXBb6pk0px/xU9DvkqCjoWTZ6JjmNi2e6L2XuNOP34wQyt7XB3x6kYZ0qR91r6tIE= X-Received: by 2002:a05:6e02:1b89:: with SMTP id h9mr4270887ili.297.1631641105161; Tue, 14 Sep 2021 10:38:25 -0700 (PDT) MIME-Version: 1.0 References: <1301054857.197399065.1631259238004.JavaMail.root@zimbra65-e11.priv.proxad.net> <515e7486-9636-e698-b811-9574bf0bedc3@bothner.com> In-Reply-To: <515e7486-9636-e698-b811-9574bf0bedc3@bothner.com> From: Damien Mattei Date: Tue, 14 Sep 2021 19:38:14 +0200 Message-ID: Subject: Re: define-syntax can only be used with local variables To: Per Bothner Cc: phiroc@free.fr, kawa@sourceware.org X-Spam-Status: No, score=-1.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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" 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 17:38:27 -0000 downloading a binary version ok kawa from the official web site , i get the same error, with the same openjdk 16: mattei@macbook-pro-touch-bar bin % export JAVA_HOME=/opt/homebrew/Cellar/openjdk/16.0.2 /opt/homebrew/Cellar/openjdk/16.0.2 mattei@macbook-pro-touch-bar bin % pwd /Users/mattei/kawa-3.1.1/bin mattei@macbook-pro-touch-bar bin % ./kawa #|kawa:1|# (define-syntax nil2! #|.....2|# (syntax-rules () #|.....3|# ((_ x) #|.....4|# (set! x '(0))))) #|.....5|# (define y '(1)) #|kawa:6|# (nil2! y) #|kawa:7|# y (1) i will try the source version perhaps damien On Tue, Sep 14, 2021 at 7:27 PM Per Bothner wrote: > > > On 9/10/21 12:33 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). > > I'm guessing (without having tested it) that the restriction isn't local > variables > but lexical vs dynamic variables. I.e. it is likely that module-level > (library-level) > variables would also work. > > Probably a problem with macro hygiene. Though it's weird that it behaves > differently on > different systems. Possibly different Java versionor different Kawa > versions (though > I don't recall changing anything in this area in a while). > > Could be a nice exercise to figure out for someone who > wants to understand how Kawa macro hygiene works. > -- > --Per Bothner > per@bothner.com http://per.bothner.com/ >