GNU bug report logs - #75997
(ice-9 match): warning: unused variable `failure'

Previous Next

Package: guile;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Sat, 1 Feb 2025 20:09:01 UTC

Severity: normal

To reply to this bug, email your comments to 75997 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#75997; Package guile. (Sat, 01 Feb 2025 20:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sat, 01 Feb 2025 20:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: bug-guile <at> gnu.org
Subject: (ice-9 match): warning: unused variable `failure'
Date: Sat, 01 Feb 2025 21:08:32 +0100
[Message part 1 (text/plain, inline)]
Hi,

--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 match))

(match-lambda (_ #f))
--8<---------------cut here---------------end--------------->8---

This source code leads to a warning when compiled:

--8<---------------cut here---------------start------------->8---
$ guix shell guile-next -- guild compile -W3 -o /tmp/xx.go /tmp/xx.scm
/tmp/xx.scm:3:0: warning: unused variable `failure'
wrote `/tmp/xx.go'
--8<---------------cut here---------------end--------------->8---

Looking at the expansion

--8<---------------cut here---------------start------------->8---
(lambda (expr)
  (let* ((v expr)
         (failure
           (lambda ()
             ((@@ (ice-9 match) throw)
              'match-error
              "match"
              "no matching pattern"
              v)
             #f)))
    #f))
--8<---------------cut here---------------end--------------->8---

the `failure' is indeed unused.  I took a look at the source code but it
is bit beyond my current abilities, so I am not sure how to fix it.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.