From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Fwd: expression and definition context in Scheme Date: Mon, 29 Aug 2022 12:10:00 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000024317a05e75e78b9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14862"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel , guile-user Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Aug 29 12:16:46 2022 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oSboz-0003el-Lb for guile-devel@m.gmane-mx.org; Mon, 29 Aug 2022 12:16:45 +0200 Original-Received: from localhost ([::1]:59654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSboy-0004VC-C1 for guile-devel@m.gmane-mx.org; Mon, 29 Aug 2022 06:16:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSbij-000765-ID; Mon, 29 Aug 2022 06:10:24 -0400 Original-Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]:46012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSbih-0005Wy-OH; Mon, 29 Aug 2022 06:10:17 -0400 Original-Received: by mail-lf1-x130.google.com with SMTP id w8so1402308lft.12; Mon, 29 Aug 2022 03:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc; bh=pKK5B006Am58N/oYUqdPNp/eMLIFQDwmUS3gRJhBYpg=; b=YT7ZdETDCi83bQhmaGndghY5pRcxLVuAKnGGdycioxkv/u5trRZ8hg9pXWSAd520DC n7/3ojBr8QRYA+AsiKHt3aqobg1NGduXmmMPB+UbyTP0Qvjyqld6p+/ZPu6YDvB39gJD 2vkJCBLgPWgorfDuSyDVvivNSbkWlntEMpHgXUdCXiAUv40rZrvjYELF5EyeCub51WcE mkKBNO56hUOc1uRCnGUOgrcfp69DQVIFVlBDNnGHPYPx5vnkpubgnnjMGzUiARz02uF+ mTZzoaoA2GU0UCekmYEBU4RD7P3VAxT3hEeB063L32elhrNTDI3b4y3vX1ddGKf+56a/ 3TFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc; bh=pKK5B006Am58N/oYUqdPNp/eMLIFQDwmUS3gRJhBYpg=; b=eKC6mI8WCHMIbxvk5nMrdo4xw1PhmUgJXL4b17NZzzhYMvghYG0/rGGqjHPuNCVe2v /xvdNVH1KQSUd+cwUw6XRduLW/jaMwAYrqqULUEq0MvRbwF1k8+UpK8qZO85CFHIfz2f eAFJ1taTFgv9/LYz8IyAPG9CGNqV5AfKT8rZxBB081GJuJ/EjmsVctncBi4de6NFLFPf cKb42csUJOFsG03NpHtogBKOBwu5hGjNNBAcUzvujmhPOonqamjdYtbRPW9Ag7Fcswxc VF5cYFzW/5VxJXs03pDIX/C77RylXhVHUtoSpchFCX1RFxnaGYbjSpo0bYn4M1AqhjaM N6hw== X-Gm-Message-State: ACgBeo0Qj6C4Ett1p3VgOKsr9VvTFaL5O3VzxVixiIdlmEqXjmBvERYr wyQ8nDvUyrNByOP5oVlKbSOx1393TXjOOlp2UeYOdExF X-Google-Smtp-Source: AA6agR7MPIM/rj2zzblAQugam+JifC+h7ninHFTaJcLQUDOse//F1/B5U5CwJ93AT0up9QRY0My75cYSgi0HgTNPSaw= X-Received: by 2002:a05:6512:22c8:b0:494:66ab:63ac with SMTP id g8-20020a05651222c800b0049466ab63acmr2222150lfu.508.1661767812131; Mon, 29 Aug 2022 03:10:12 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=damien.mattei@gmail.com; helo=mail-lf1-x130.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21336 gmane.lisp.guile.user:18547 Archived-At: --00000000000024317a05e75e78b9 Content-Type: text/plain; charset="UTF-8" ---------- Forwarded message --------- From: Damien Mattei Date: Mon, Aug 29, 2022 at 12:09 PM Subject: Re: expression and definition context in Scheme To: Maxime Devos yes , the same with 'while too, i will make it in my Scheme+ to allow inner 'define in those blocks without other stuff (in Scheme+ i had already a simple macro : (& ev ...) = (let () ev ...) that replace 'begin when 'define is needed in blocks. regards, Damien On Sun, Aug 28, 2022 at 11:30 AM Maxime Devos wrote: > On 28-08-2022 08:40, Damien Mattei wrote: > > in fact my thought was not clear, perhaps just allow a 'define in an > instructions as 'when in my example , 'define-ed variable would then be > local one in the block of 'when, will it change something in scheme > implementation in a bad way? > > Are you asking for 'when' to implicitly wrap its body in a (let () ...)? > > If so, that's trivial to implement, without changing the Scheme > implementation: > > (define-syntax-rule (when cond exp ...) > (if cond > (let () exp ...))) > > Greetings, > Maxime. > --00000000000024317a05e75e78b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

---------- Forwarded message ---------
From: Damien Mattei <damien.mattei@gmail.com>
Date: M= on, Aug 29, 2022 at 12:09 PM
Subject: Re: expression and definition cont= ext in Scheme
To: Maxime Devos <maximedevos@telenet.be>


yes , the same with 'while too, i will make i= t in my Scheme+ to allow inner 'define in those blocks without other st= uff (in Scheme+ i had already a simple macro : (& ev ...) =3D (let () e= v ...) that replace 'begin when 'define is needed in blocks.

= regards,
Damien

On Sun, Aug 28= , 2022 at 11:30 AM Maxime Devos <maximedevos@telenet.be> wrote:
=20 =20 =20

On 28-08-2022 08:40, Damien Mattei wrote:

in fact my thought was not clear, perhaps just =C2=A0allow a 'define in an instructions as 'when in my example , 'define-ed variable would then be local one in the block of 'when, will it change something in scheme implementation in a bad way?=

Are you asking for 'when' to implicitly wrap its body in a (= let () ...)?

If so, that's trivial to implement, without changing the Scheme implementation:

(define-syntax-rule (when cond exp ...)
=C2=A0 (if cond
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let () exp ...)))

Greetings,
Maxime.

--00000000000024317a05e75e78b9--