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: Exporting a nonexistent variable Date: Wed, 13 Nov 2024 22:22:58 +0000 Message-ID: References: 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="6726"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org To: =?utf-8?Q?Tommi_H=C3=B6yn=C3=A4l=C3=A4nmaa?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Nov 13 23:23:45 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 1tBLm4-0001cI-Hi for guile-devel@m.gmane-mx.org; Wed, 13 Nov 2024 23:23:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBLlc-0003g0-0S; Wed, 13 Nov 2024 17:23:16 -0500 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 1tBLlX-0003el-7s for guile-devel@gnu.org; Wed, 13 Nov 2024 17:23:11 -0500 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 1tBLlU-0004Zj-6R for guile-devel@gnu.org; Wed, 13 Nov 2024 17:23:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1731536583; x=1731795783; bh=LCsIielPLrRmJy4MX0KqzCBP4T5D25B7XrmtqXRxXBw=; 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:List-Unsubscribe:List-Unsubscribe-Post; b=Yn9bhDcDFW7s2w0k63vm9OwmETHkGP2nfg1Gipz9mpe7NRZJ1ctxHwSmoBzmdpFF9 Bq9Cu0itC44+AC9ptcgjTxDh5DGWDTgbsh9VDOFPXvC5Ho4b8l6+WEPmh85s5Diufk 9WqQ+6XNdimG2tjVXWY/ljSl+D3Pm7ti4CE/R77GcHoL7Ld3LULR49E3fLE73wgVwS CL0g7BV9zzO/BeOnSHjqCRykg+tpemCiI2XH8fGw7IikERmf4IkvEAuabxvZ6uqagv D0iQM+W879mumLXxRyP8jMXosFGXcVKRUAu7mF+ptkr8IVLi+i2HRc8X2tufrd8EUV Oa1agjfeAQ1jw== In-Reply-To: Feedback-ID: 28384833:user:proton X-Pm-Message-ID: 48b88a15c810e38905867e6cbd5d1d902e98b1cb 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_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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:22772 Archived-At: > I think Guile could report a warning if a nonexistent variable is > exported as the cause of this kind of errors may be difficult to find in > a large program. you are exporting _symbols_ (unique identities) from modules, not variables= (or bindings). there are various use-cases where one wants to export a symbol from a modul= e without binding any value to it in the module where it is being exported = from. > WARNING: (guile-user): `myproc' imported from both (mod1) and (mod2) this^ is key, never ignore such warnings! i'd go as far as to suggest that = this warning should be turned into an error. that would force the author to= fix his package definitions to explicitly resolve such collisions. sidenote: any serious codebase should compile with zero warnings, otherwise= people start to ignore such warnings, they accummulate, and then waste pre= cious programmer attention in debugging sessions. our (Common Lisp) team used to have a running joke that if a situation just= doesn't make any sense, then it must be a package (module) issue: `foo` an= d `foo` may print the same, but can be different identities. > Backtrace: > In ice-9/boot-9.scm: > 1762:12 4 (with-exception-handler _ _ #:unwind? _ # _) > In unknown file: > 3 (apply-smob/0 #) >=20 > In ice-9/boot-9.scm: > 731:2 2 (call-with-prompt ("prompt") # =E2=80=A6) >=20 > In ice-9/eval.scm: > 619:8 1 (_ #(#(#))) >=20 > In program.scm: > 6:3 0 (main _) >=20 > program.scm:6:3: In procedure main: > Unbound variable: myproc there are two `myproc` symbols at play here, and you're trying to dereferen= ce the one that has no value bound to. you've been warned prior to this. --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- You cannot wake up someone who is only pretending to be asleep. =09=E2=80=94 Indian proverb