From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.devel Subject: Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses Date: Sun, 06 Feb 2022 10:45:54 +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: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15515"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-4586-g104bd556f9-fm-20220203.002-g104bd556 To: tomas@tuxteam.de, guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Feb 06 11:18:59 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 1nGedD-0003iB-GZ for guile-devel@m.gmane-mx.org; Sun, 06 Feb 2022 11:18:57 +0100 Original-Received: from localhost ([::1]:34970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGedC-0007Jc-2g for guile-devel@m.gmane-mx.org; Sun, 06 Feb 2022 05:18:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGe85-0003kz-KI for guile-devel@gnu.org; Sun, 06 Feb 2022 04:46:46 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:55833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGe81-0004s9-Us for guile-devel@gnu.org; Sun, 06 Feb 2022 04:46:44 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 331595C00F3; Sun, 6 Feb 2022 04:46:15 -0500 (EST) Original-Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Sun, 06 Feb 2022 04:46:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=PiLCb4U4e2unjc wqykrI8iKBlADOmy2E3dA6em7SAC4=; b=HpNbyQNYh39vbA/20ocK/oQuxk6mfo 6I+5ZxxZlkcxyOjeSuxQ4iJzvSbirI7bY3kZuVWXKKiZVWKNeHpN+6o/D+Nj+ro1 KpE1yeo3k0t9HUmKKmKUUbWkibEM3h1y2Ffi6fhgCldMdMRTWZi7ZXOSNxl+xD1F rZEsEFaBasOvhmep1f6RAKqke7k96vfwUpQZYrQunFXzS/G52jjX+1KKesTF1AUP 14dKLcW/AAAPPLx3XVeot8rRzUeiynduJ4CDyOByR6H2JkhReGRZswT0gD/CU3HS LL13EisERJSg2540JlShTaEynEOI8uV8xmLXQPI3ujsqu2L8687IT9Qw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=PiLCb4U4e2unjcwqykrI8iKBlADOmy2E3dA6em7SAC4=; b=oqpFguQH XwlA7yEhCwizjgLnKDgiiYlnqaz27KXBbzA6DoJWmsV3aUmTMZREYVvr6eISYSWh VS31YSLSQnH3d476y1+W0ZBFRqnkBSqVyA/TwmHB1Uk9OwDjWhuZDqW2k84qnr8a wwp9Cib6skcREoZ2RL9FlVuBtvLi0Qw59TsZJl7cvpN4Vk+VXA9qx80RQxpNtNyC +9buR0xBdthcEaI9UOuE00lUP+W9Eh0o4cs0G6bXqJtDmjLOth7zm2x2Jb7GCQL1 Wr4rc4iWGFHB+hKQ3qbUEQSi24egZ37gsnKbNeI/hPJTlnap9OVea8r0g3KNmi8r eDMO6tpC7rjGjQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrheefgddtjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgfgsehtqh ertderreejnecuhfhrohhmpefnihhnuhhspgeujhpnrhhnshhtrghmuceolhhinhhushdr sghjohhrnhhsthgrmhesvhgvrhihfhgrshhtrdgsihiiqeenucggtffrrghtthgvrhhnpe etvdeuteehueektefhuddvjeelteffuedvvdeuudeiuedvtedtueehhedvjeeiffenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlihhnuhhsrd gsjhhorhhnshhtrghmsehvvghrhihfrghsthdrsghiii X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id CD9DC1BC0072; Sun, 6 Feb 2022 04:46:14 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: Received-SPF: pass client-ip=66.111.4.26; envelope-from=linus.bjornstam@veryfast.biz; helo=out2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-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:21077 Archived-At: You need to use ,optimize.=20 --=20 Linus Bj=C3=B6rnstam On Sun, 6 Feb 2022, at 10:27, tomas@tuxteam.de wrote: > 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 e= arth=20 >> > do you not have an implicit let?, Just laziness? >> > There should be a good reason or? this is a pretty fundamental cha= nge=20 >> > that I support but then we should not be lazy not trying to underst= and=20 >> > the design choices of the old beards. >>=20 >> In other languages let starts a new lexical context which can be expe= nsive. I don't know guile internals but a let without any defines is tri= vially 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)) > > ...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 > > Attachments: > * signature.asc