From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Attila Lendvai Newsgroups: gmane.lisp.guile.devel Subject: Re: Define works different when Compile and Eval Date: Sat, 22 Jun 2024 12:57:45 +0000 Message-ID: References: <875xu5i9qr.fsf@trop.in> <87r0cq8ogp.fsf@trop.in> 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="5649"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org To: Andrew Tropin Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Jun 22 14:58:13 2024 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 1sL0Jo-00018h-5R for guile-devel@m.gmane-mx.org; Sat, 22 Jun 2024 14:58:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sL0Jc-0006BZ-4i; Sat, 22 Jun 2024 08:58:00 -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 1sL0JZ-0006B7-Jd for guile-devel@gnu.org; Sat, 22 Jun 2024 08:57:58 -0400 Original-Received: from mail-4018.proton.ch ([185.70.40.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sL0JW-0008Cd-Ne for guile-devel@gnu.org; Sat, 22 Jun 2024 08:57:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1719061070; x=1719320270; bh=DtV/HmLZhgUEfA/SK36ONLQU6/s8rkTBnc3Bl3SpGQ4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=hPNA5c0gPhgkHG0dmxHYQVq1wA1ms7GwCw6yyvHS4FjVjdFd01nWRqYbQGaDypAkh eQzUXatJDKVMuVf2V5L9DoTQCRjM8b+wTRC8EiqVxCB8yrcNMqoZohLg22vROmeaGx i54GrGKQosFrIrMySzM3DC3IaT2RXRZTAClWmSrWXtVZeiMXJQgkU63GKrbol83I6v 4/mzX02OrfFEpT0LftOtvMARMzJetpMxG1sAqO63txWOaEHPDnGOCpAzjxOyP8lqMA QubTP0R+l9ASKAFd9PqJqqrVv+jtA3M4tYi5r0qTBZRECs0FG7jeU5DAI0L9C/b7NJ Kf6ojd1DxOGNg== In-Reply-To: <87r0cq8ogp.fsf@trop.in> Feedback-ID: 28384833:user:proton X-Pm-Message-ID: 1f68aee6ce9d7e525c029cb14b739e9b63cd5881 Received-SPF: pass client-ip=185.70.40.18; envelope-from=attila@lendvai.name; helo=mail-4018.proton.ch 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, RCVD_IN_MSPIKE_H4=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-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:22460 Archived-At: > > if you want this^ to be actually defined while compilation is > > happening (i.e. in the compilation stage; see staged computing), then > > you need to use an (eval-when (expand) ...) wrapper around it. >=20 >=20 > Thank you for the reply! Not sure what you mean. The following code > defines `a`: i ran with some ungrounded assumptions, and i basically explained how it wo= rks in CL, not in Guile. sorry about that! i played a little with your test now. maybe i'm stating the obvious here, but its behavior is in harmony with the= hypothesis that the compilation of DEFINE (wrongly) evaluates the value in= the newly updated environment (as opposed to the "parent" environment, i.e= . the one before the definition has been added/set). i briefly tired to find the place where DEFINE is compiled to check this hy= pothesis in the code, but i couldn't find it. --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CI find television very educating: Every time somebody turns on the= set, I go into the other room and read a book.=E2=80=9D =09=E2=80=94 Groucho Marx