[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66057: (ice-9 match) allows invalid usages of ... or ..1
From: |
Jean Abou Samra |
Subject: |
bug#66057: (ice-9 match) allows invalid usages of ... or ..1 |
Date: |
Sun, 17 Sep 2023 20:36:45 +0200 |
User-agent: |
Evolution 3.48.4 (3.48.4-1.fc38) |
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.
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
Description: This is a digitally signed message part