From: Jean Abou Samra <jean@abou-samra.fr>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>, 66057@debbugs.gnu.org
Subject: bug#66057: (ice-9 match) allows invalid usages of ... or ..1
Date: Sun, 17 Sep 2023 20:36:45 +0200 [thread overview]
Message-ID: <862c98bacabb178176c779d4a982d6686d305aae.camel@abou-samra.fr> (raw)
In-Reply-To: <87cyyg8y1a.fsf@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1300 bytes --]
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.
[-- Attachment #1.2: Type: text/html, Size: 2532 bytes --]
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-09-17 18:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-17 18:17 bug#66057: (ice-9 match) allows invalid usages of ... or ..1 Maxim Cournoyer
2023-09-17 18:36 ` Jean Abou Samra [this message]
2023-09-18 0:59 ` Maxim Cournoyer
2023-09-18 9:28 ` Jean Abou Samra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=862c98bacabb178176c779d4a982d6686d305aae.camel@abou-samra.fr \
--to=jean@abou-samra.fr \
--cc=66057@debbugs.gnu.org \
--cc=maxim.cournoyer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).