Subject: bug#66057: (ice-9 match) allows invalid usages of ... or ..1

From: Jean Abou Samra <[email-masked]>
Date: Sun, 17 Sep 2023 20:36:45 +0200

Le dimanche 17 septembre 2023 à 14:17 -0400, Maxim Cournoyer a écrit :
> Hi,
> 
> After attempting the following:
> 
> --8<---------------cut here---------------start------------->8---
> (match (string-split "./Bootloaders/Printer/Documentation/html" #\/)
>                                  (("." path ..1 "Documentation" "html")

For a start, where does that "..1" syntax come from? To my knowledge, no such
syntax is supported by Guile's pattern matcher, which AFAIK is the one described
in SRFI-204.

https://srfi.schemers.org/srfi-204/srfi-204.html

So your example is just binding the string "Printer" to the variable "..1":
since "..1" doesn't have any special meaning, it's just a pattern variable.

>                                   (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,

??

This is not what SRFI 204 says, and it's not consistent with syntax-rules and
syntax-case patterns either.