bug#75997: (ice-9 match): warning: unused variable `failure'
Tomas Volf <[email protected]> Sat, 01 Feb 2025 21:08:32 +0100
| Newsgroups | gmane.lisp.guile.bugs |
|---|---|
| Message-ID | <[email protected]> |
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, 853 B)
-----BEGIN PGP SIGNATURE----- iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmeef0AOHH5Ad29sZnNk ZW4uY3oACgkQL7/ufbZ/wanrpQ//RikmfAJM1tVYnW/ei9k+esLOQ1+TXs8KjMbG ijw1UdNp81jDvZVqbHdBiN5Hi/XmiywHjHdOgIpWd7OMhHPyBWXx1CsunDfV8V9I ZEXxg3ruLAk4DKD4i/bobuK2P1khgeIFTxptdjgpZw3GS25fZfdgoUlzsPt4wrmQ 4YWIiKzgGQE//+D/geH9vs/MyOneGNiAF/QlDunkIKcy4owmmk7kTKhgql3JnNNC AmFDF85fYBgOx9UuMq+vW50T6nCoPRs36sj/3kVDtnvW3dp+tiwx6iNg7uBBw8CX GZWA/CCzbG8lE9zkZ4W47B6XdDHykcobx8qaG+I0n/7wT6WDcQexcygzW8XTB411 mDJMOwiyPFbT05L8oNb4PK+eN9F7w9qj6l0wmhJoOTb6/y3i4va2sOxX4OOjeq7i 3WGWfoCDXowfIwEe3JduX/W/9Q56pAbnu2MY6HlPPT1t7FkGr3HNmw/uLncsEveA FBKca1jklP6JWam7PeYiSY/NBVGgXNpESkAmLw5pzu+EqW1e30K8NiYGF7ojh8/i Uyp3IsOn/jzH/s7nkFiZSPbqYpY7wknJHnFzc+VyoqvfOIQZnOgANb3EiXbjU8mw EuYUkLmdlnWbBze1yw/jsmHEWM8soqV/Y75s8Jr+1QaNk3wEb4Aj8KDHMEH+RCoc memGOIk= =CXsg -----END PGP SIGNATURE-----