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: Inconsistency with expressions between definitions Date: Sun, 24 Sep 2023 13:58:32 +0200 Message-ID: References: <87o7hsujrk.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33819"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Sep 24 15:35:29 2023 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 1qkPGh-0008Xq-OM for guile-devel@m.gmane-mx.org; Sun, 24 Sep 2023 15:35:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkPGT-0006Z6-IP; Sun, 24 Sep 2023 09:35:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkNl1-0004je-Fv for guile-devel@gnu.org; Sun, 24 Sep 2023 07:58:40 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkNkz-0000Ax-9t for guile-devel@gnu.org; Sun, 24 Sep 2023 07:58:38 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B08AF5C0145 for ; Sun, 24 Sep 2023 07:58:34 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 24 Sep 2023 07:58:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.se; h= cc:content-transfer-encoding:content-type: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=fm2; t= 1695556714; x=1695643114; bh=4/EngLH1OLG98Y2CXjITjrPdxlkIqmQqozc O+3uiqo8=; b=qeESDRKbh8d1SHpMm4LZDEZg/6FamAH1mL7G4UCj/LbdgJgw1Ed xXrjfWfKzA2muWCunvAD7AALAvol9HHUORSljs68MmmDiVLZ1yHxzhUA/t0EOkpd C3iUXoVG1qQa9UhCvcL9aWNl1uX5w9h/UvD9qxrytJXM8OYSKCrLzVsFcLCFQAwx /H9PlBaIu+3Whrl8eSbXn9312/pcUEZF1HLGl6GZwmhaa+UL0EOovaHEjspxRBMB aSnunTqecU416V8XVEE75dLlYMS2EusT9F8/oUlZaAln/1e5yLKVWgeG/uDMDDCj CLGhgp+A9epZgrV3EPzekvPObPPwJ9CehRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id: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; t=1695556714; x= 1695643114; bh=4/EngLH1OLG98Y2CXjITjrPdxlkIqmQqozcO+3uiqo8=; b=B Aecf9DT6X0DfYibC+7kYAVOe6MMKEJLNdbPjhucGHDeotFEtV9ihudeX02UuNLvf IXQAofBVroWfSGHDfumPq2rinPyc9eMNaVMlU5VHNhSDhLHB+PGulZC9HxZLqNXi uDlHblW+PEybmoPS8Lhpypg/RtUsEBBD/YFOrXXp2Gnn+GJuOlrQkginLVzqBysf bJatx2mhSz+E++czaiL97eACGUin3QrkMhEYpik+J34OIlRpaO4mFhX/VawN9IsV qxqrVWiXA5gveFNnbFwf+itOGTckK9pW2p0CUPaIkVYBGtblsChVCKNNW4S1E+LD IvJORbHkmfa1YdKskOi9g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudelvddggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtvdejnecuhfhrohhmpefnihhnuhhsuceujhpnrhhnshhtrghmuceolhhinhhushdr sghjohhrnhhsthgrmhesfhgrshhtmhgrihhlrdhsvgeqnecuggftrfgrthhtvghrnhepke fhffefteelvedtfeduheefudffledvgeetffeikefhieeuudeiueevveetuddtnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhinhhushdrsg hjohhrnhhsthgrmhesfhgrshhtmhgrihhlrdhsvg X-ME-Proxy: Feedback-ID: ie8bb436e:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 24 Sep 2023 07:58:34 -0400 (EDT) Content-Language: en-US In-Reply-To: <87o7hsujrk.fsf@web.de> Received-SPF: pass client-ip=66.111.4.29; envelope-from=linus.bjornstam@fastmail.se; helo=out5-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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 24 Sep 2023 09:35:11 -0400 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-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21973 Archived-At: Hey! When you are not referencing x before defining y everything works as you want. There is no, so to say, temporal dependency on how the things are bound. When you introduce (display x) before actually defining y you force letrec* to bind x to the unspecified value, because display has side-effects and you don't move around side-effecting code. If you do (display "heippa!") instead it works as you want. I believe racket (which does the same optimization) has the same behaviour. -- Linus Björnstam Den 2023-09-24 kl. 09:09, skrev Dr. Arne Babenhauserheide: > Hi, > > while writing a comment to SRFI-245 I think I found an inconsistency in > the Implementation in Guile. > > This works: > > (define (using-later-variable) > (define x y) > (define y #t) > x) > (using-later-variable) > ;; => #t > > This still works: > > (define (using-later-variable) > (define x y) > (newline) > (define y #t) > x) > (using-later-variable) > ;; => (newline output) > ;; => #t > > This fails: > > (define (using-later-variable) > (define x y) > (display x) > (newline) > (define y #t) > x) > (using-later-variable) > ;; => # > > Best wishes, > Arne