bug#66057: (ice-9 match) allows invalid usages of ... or ..1
Jean Abou Samra <[email protected]>
| Newsgroups | gmane.lisp.guile.bugs |
|---|---|
| Message-ID | <[email protected]> |
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.
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZQdHPQAKCRCj8PYLiTOX /hvNAP0bQCI8nD9tmZMJauKabRLAhh+huksgcpS2T7gYcGPJnAD+MUr3tETkLALv l6S309Fl1cQ1yn+fx28i6vuu6yjuvwg= =x/RS -----END PGP SIGNATURE-----