GNU bug report logs - #66057
(ice-9 match) allows invalid usages of ... or ..1

Previous Next

Package: guile;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sun, 17 Sep 2023 18:18:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 66057 <at> debbugs.gnu.org
Subject: bug#66057: (ice-9 match) allows invalid usages of ... or ..1
Date: Sun, 17 Sep 2023 14:17:21 -0400
Hi,

After attempting the following:

--8<---------------cut here---------------start------------->8---
(match (string-split "./Bootloaders/Printer/Documentation/html" #\/)
                                 (("." path ..1 "Documentation" "html")
                                  (pk 'path path)))

=> ;;; (path "Bootloaders")

Expected (and works with '...'): 
;;; (path "Bootloaders" "Printer")
--8<---------------cut here---------------end--------------->8---

and asking about it in #scheme or #guile, it seems the '..1' and '...'
patterns *must* be used strictly to match at the end of lists, but this
isn't explicitly mentioned in the manual, and even works for ... but not
for ..1, which is inconsistent/econfusing.

It was suggested by Zipheir in #scheme that Guile should return a syntax
error when ..1 or ... are used somewhere else than at the end of a list.
It seems a good suggestion.

-- 
Thanks,
Maxim




This bug report was last modified 1 year and 269 days ago.

Previous Next


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