From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.lisp.guile.devel Subject: Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses Date: Sun, 6 Feb 2022 10:27:51 +0100 Message-ID: References: <7f58438c-f2fb-49b6-b7b0-22054fde6277@www.fastmail.com> <38a7683ab39f412cd6f5b137d2f6ebd6f5410c5e.camel@telenet.be> <8db379b94c9d724c833478db7e6e8a6a4f379f69.camel@telenet.be> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p+rLiV6uECfuVMLW" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35338"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Feb 06 10:31:26 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 1nGdtF-000935-HS for guile-devel@m.gmane-mx.org; Sun, 06 Feb 2022 10:31:25 +0100 Original-Received: from localhost ([::1]:40014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGdtE-0002SW-3W for guile-devel@m.gmane-mx.org; Sun, 06 Feb 2022 04:31:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGdpv-000842-6q for guile-devel@gnu.org; Sun, 06 Feb 2022 04:27:59 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:51632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGdps-0002EW-LB for guile-devel@gnu.org; Sun, 06 Feb 2022 04:27:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6oX+nGmdob/yWBrGy1UY45XXcbI/vRghF8CdzVBG1nw=; b=L9OgiR3KK3OD4E85YirN7ob2s0 0LojPCMgxfHq6v/Po+BVEKaG8tDDf0iL36xPD0HJ7VhkEFRGmZxF8WVTdwdYkQwpr2C1f1nZq6H+N j7Xf29Q2Pmo/qKI4JlO6fk1sXx51RnsCP4NjBXGlzKkk5KkMFqABAc0Zb9y/mLJhDolC3ktRsDXEM 1HtuY//CEMDMZac39Tt2Yxn9pqo5dslOiHR0/sLt/Kk+KnIaLH9HxPksG7KCNlh0lk8hhFjsnrmPm ZdraxCgMvbkNKWuSI2Qu9lbT3zPb+xSicwPSj83kBDCT863rUMlBd8+f+E9sK5qgDn9VJDk+/owzf TUrDKR/w==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1nGdpo-0002Zc-0C for guile-devel@gnu.org; Sun, 06 Feb 2022 10:27:52 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de 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, 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:21076 Archived-At: --p+rLiV6uECfuVMLW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 06, 2022 at 07:44:31AM +0100, Linus Bj=C3=B6rnstam wrote: >=20 > On Sat, 5 Feb 2022, at 18:31, Stefan Israelsson Tampe wrote: > > Hmm this was wrong, I mean > > > > For conditional variables we have a default begin. So then why on earth= =20 > > do you not have an implicit let?, Just laziness? > > There should be a good reason or? this is a pretty fundamental change= =20 > > that I support but then we should not be lazy not trying to understand= =20 > > the design choices of the old beards. >=20 > In other languages let starts a new lexical context which can be expensiv= e. I don't know guile internals but a let without any defines is trivially = converted to a begin by the optimizer. It seems that in Guile 3 the expander is smart enough for an empty bindings list in let: | tomas@trotzki:~$ guile | GNU Guile 3.0.7.6-22120 | Copyright (C) 1995-2021 Free Software Foundation, Inc. [...] | scheme@(guile-user)> ,expand (let () (message #t "Yikes")) | $1 =3D (message #t "Yikes") | scheme@(guile-user)> ,expand (let ((x 3)) (message #t "Yikes ~S" x)) | $2 =3D (let ((x 3)) (message #t "Yikes ~S" x)) =2E..but doesn't "see" whether bindings are actually used (quite possibly those go away in a later optimisation phase, though): | scheme@(guile-user)> ,expand (let ((x 3)) (message #t "Yikes")) | $3 =3D (let ((x 3)) (message #t "Yikes")) Cheers --=20 t --p+rLiV6uECfuVMLW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCYf+UkQAKCRAFyCz1etHa RnKZAJ9c4Ey20owe8v8ayh2w+A8q2Q26xgCfcVYPFiYcWpPWVxw/Pc/s+9Yk8Ps= =31JW -----END PGP SIGNATURE----- --p+rLiV6uECfuVMLW--