From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.devel Subject: Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses Date: Sat, 05 Feb 2022 00:39:03 +0100 Message-ID: <8db379b94c9d724c833478db7e6e8a6a4f379f69.camel@telenet.be> References: <7f58438c-f2fb-49b6-b7b0-22054fde6277@www.fastmail.com> <38a7683ab39f412cd6f5b137d2f6ebd6f5410c5e.camel@telenet.be> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-oqc9OmAgNeIatDI4ZkES" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30954"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.38.3-1 Cc: guile-devel@gnu.org To: Stefan Israelsson Tampe Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Feb 05 00:39:37 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 1nG8Az-0007rD-BI for guile-devel@m.gmane-mx.org; Sat, 05 Feb 2022 00:39:37 +0100 Original-Received: from localhost ([::1]:42606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nG8Ay-00022d-8f for guile-devel@m.gmane-mx.org; Fri, 04 Feb 2022 18:39:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nG8Ae-00022M-7q for guile-devel@gnu.org; Fri, 04 Feb 2022 18:39:16 -0500 Original-Received: from [2a02:1800:120:4::f00:13] (port=41532 helo=baptiste.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nG8Ab-0000kl-S3 for guile-devel@gnu.org; Fri, 04 Feb 2022 18:39:15 -0500 Original-Received: from [192.168.43.254] ([5.23.235.206]) by baptiste.telenet-ops.be with bizsmtp id rBf82600E4TrpFp01Bf9V5; Sat, 05 Feb 2022 00:39:09 +0100 In-Reply-To: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1644017949; bh=18V89fWNMz2yMm51efgmjx9OV17dikAngz9DI6EB8mQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=SV4NekcEahFKaITvAWpB4as0Y8MQMASoeuxga7xqO8yg1IY4EYYlngJnOUlOoFFQ4 8to1Uw1J959M/Y9G19E71hLiYWa225IjpnyDruoAYtcNgyspZRx0UEif8di2QzaV/8 KCzgjpGW/r//znHuS9HwiiYJ7q+8egOM7agsJtkgfOeYDQZm9uoLHUGTaQ6jvmeqb1 NE99+DdVlEzPROnb1sec2Tg0qNE5+SiohZiuOEhDJeoHXgt9dsuPKktQ748GL7P17t /LagpqOYczlu+VqlN0KLPzoFC5II+Co+kRTYoPkpGQIXlZO9ggdNOevJEOh1U2D+rV 8qaMNy2A2srew== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:120:4::f00:13 (failed) Received-SPF: pass client-ip=2a02:1800:120:4::f00:13; envelope-from=maximedevos@telenet.be; helo=baptiste.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:21069 Archived-At: --=-oqc9OmAgNeIatDI4ZkES Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Stefan Israelsson Tampe schreef op vr 04-02-2022 om 22:40 [+0100]: > Anyhow conditional defining vars is a common theme in other languages > so I think it was kind of natural to implement if as it was done. AFAIK no Lisp or Scheme except for Guile < 2.0 implements conditionally defining local variables (but then I usually only consider Guile Scheme and the RnRS, so this doesn't mean much). In my experience, I have never seen a need for conditionally defining a local variable in Scheme code (if you have a real-world example, please share). It also seems impossible to implement this w.r.t. the macro system --- what should, say, bound-identifier=3D? do when one of its identifiers is only conditionally bound? Or for another example: If I do (define foo 'bar) (define-syntax foobar (syntax-rules (foo) ((_ foo) (begin (pk "it's a foo!") foo)) ((_ goo) (begin (pk "it's not a foo ...") goo)))) =20 (define (zebra stripes) (if stripes (define foo 'quux)) (foobar foo)) ;; <--- *** then sometimes the 'foo' in '***' refers to the global variable 'foo' and hence 'foobar' expands to the "it's a foo'.' Sometimes the 'foo' in '***' refers to the local variable 'foo' (!=3D the global foo) hence 'foobar' expands to the "it's not a foo ...". However, it's impossible for a macro to expand to multiple things at once! Greetings, Maxime. --=-oqc9OmAgNeIatDI4ZkES Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf25FxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7osLAQCnC/OyiPBWpvZHo2GFLl80W4xW 530wkrayP8vwtQUTfAEA3EYGSS3BG38SJNF6EXvgdzvKmNEu9bnThhHgZVVoFQo= =S/GR -----END PGP SIGNATURE----- --=-oqc9OmAgNeIatDI4ZkES--