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.user Subject: Re: warning: possibly unused local top-level variable `%foo?-procedure' Date: Thu, 06 Jun 2024 22:02:50 +0200 Message-ID: <1674e944-f9c5-415c-ad0d-5c26efac8306@app.fastmail.com> 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="31698"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.11.0-alpha0-497-g97f96844c-fm-20240526.001-g97f96844 To: "Tomas Volf" <~@wolfsden.cz>, guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Jun 06 22:03:52 2024 Return-path: Envelope-to: guile-user@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 1sFJKw-00080T-0n for guile-user@m.gmane-mx.org; Thu, 06 Jun 2024 22:03:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFJKS-0005fi-Df; Thu, 06 Jun 2024 16:03:20 -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 1sFJKP-0005f9-Rx for guile-user@gnu.org; Thu, 06 Jun 2024 16:03:17 -0400 Original-Received: from wfhigh2-smtp.messagingengine.com ([64.147.123.153]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFJKN-0005d7-MZ for guile-user@gnu.org; Thu, 06 Jun 2024 16:03:17 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id 88A1218000DC; Thu, 6 Jun 2024 16:03:10 -0400 (EDT) Original-Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Thu, 06 Jun 2024 16:03:10 -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:subject:subject:to:to; s=fm1; t=1717704190; x=1717790590; bh=3ZgIV4I/8zO0tG2HKSOA+Rt+HmQecqA/WXbjx/LhMRY=; b= g/7qAxqVOONyxAAWCJaHNgKWL18TpZwCj0JbJp/pYkJ+tp6BNfe3Yvx6klk2y7vD zU/fwuAqm+djyGFCsxVjI17Od87IFnII+GZRxZ0ctQuZV/nDBHwW24bHniXSbSyT OyWQFldaIdNyx0U7Fd2OZmFbWvJk9buZjdJNKet8hKSYKN6O/Oj63cg1+MkbBe1x WPofzshoF3ZA9mSirJ0PAj6ZBBFZXGWbyZNeG6ozHkpH7JxoUbVktOMIl5X1ora/ nf20Snho9qV1bsXYuB2QQsdIbo0t+jymFZ8PwZ6aVq1cRoStt3kv/gPYGVh+c5k3 AVwYT4T30UdGMl/28mr03g== 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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717704190; x= 1717790590; bh=3ZgIV4I/8zO0tG2HKSOA+Rt+HmQecqA/WXbjx/LhMRY=; b=T aKzTyvc6Ln1WIQRwxnPJckcdh0lSRHJgqELBmX98tX8kfasbUoHWuLBCGcJOpef/ 53N66VlXzpD7kRxgiHpGHWeNPDDL4hXvOYqUkFJ2RIWkGnvSRIY5pgFtQ5WgAiCV ap9rjtuOILKANxOWY/kcNhFAePTMBBA5bQqOaK//N3hT+tgltEfPVEc7TYWWlJ7R JSMh5nMtTl2W/zTwLT0V2Nk8kMveT8W2Ahm7nR8fX9J2m59Rx0F4e2e0buV1RcGF eASjvwCxI4AiGOllaVvZPXMF93NVmPtHUrwJg2XoUTN71ya6tHYsnkI8DthC2pt0 lbT+ThDcI1ZQcII3G4QpA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelkedgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgfgse htqhertderreejnecuhfhrohhmpefnihhnuhhsuceujhpnrhhnshhtrghmuceolhhinhhu shdrihhnthgvrhhnvghtsehfrghsthhmrghilhdrshgvqeenucggtffrrghtthgvrhhnpe effffhleefuedvleefgeffveetgeeitddvfffhlefhhefgkeeuheeileegudeljeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlihhnuhhsrd hinhhtvghrnhgvthesfhgrshhtmhgrihhlrdhsvg X-ME-Proxy: Feedback-ID: i57f3436d:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 979CEB6008D; Thu, 6 Jun 2024 16:03:09 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: Received-SPF: pass client-ip=64.147.123.153; envelope-from=linus.internet@fastmail.se; helo=wfhigh2-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, 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-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19706 Archived-At: Which version are you using? All my similar issues with srfi-9 went away= last year when srfi things were marked maybe-unused. I don't have a computer this week so I cannot try your code. Sorry.=20 --=20 Linus Bj=C3=B6rnstam On Wed, 5 Jun 2024, at 17:02, Tomas Volf wrote: > Hello, > > I am getting following warning from a guild compile: > > warning: possibly unused local top-level variable `%foo?-procedure' > > And I am not sure how to tackle it. This is my full source code: > > (define-module (x) > #:use-module (srfi srfi-9) > #:export ( > foo? > make-foo)) > > (define-record-type (make-foo) foo?) > > When I try to compile it: > > $ guild compile -W 3 -o x.go x.scm > x.scm:7:0: warning: possibly unused local top-level variable=20 > `%foo?-procedure' > wrote `x.go' > > I would (for obvious reasons) like to keep my compilation warning-free= . I can > think of two approaches: > > 1. Export the %foo?-procedure > I think this would confuse downstream users, since they are not e= xpected to > use it directly. > > 2. Mark the procedure as used > In C I could use `(void)proc;', is there an equivalent of that c= onstruct > in Guile? > > Are there other options? How are you approaching it? > > Thank you and have a nice day, > Tomas Volf > > PS: I am not even sure why this warning happens, the `foo?' syntax tra= nsformer > is exported and *does* reference it (as far as I can tell from ,expand= ). > > -- > There are only two hard things in Computer Science: > cache invalidation, naming things and off-by-one errors. > > Attachments: > * signature.asc