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

Full log


View this message in rfc822 format

From: Tomas Volf <~@wolfsden.cz>
To: 75997 <at> debbugs.gnu.org
Subject: bug#75997: (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 110 days ago.

Previous Next


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