From unknown Fri Jun 13 10:50:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66057: (ice-9 match) allows invalid usages of ... or ..1 Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 17 Sep 2023 18:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66057 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 66057@debbugs.gnu.org X-Debbugs-Original-To: bug-guile Received: via spool by submit@debbugs.gnu.org id=B.169497466430317 (code B ref -1); Sun, 17 Sep 2023 18:18:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Sep 2023 18:17:44 +0000 Received: from localhost ([127.0.0.1]:51404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhwL1-0007su-SS for submit@debbugs.gnu.org; Sun, 17 Sep 2023 14:17:44 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhwKy-0007se-5j for submit@debbugs.gnu.org; Sun, 17 Sep 2023 14:17:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhwKl-0003jU-4B for bug-guile@gnu.org; Sun, 17 Sep 2023 14:17:27 -0400 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhwKi-00035i-OU for bug-guile@gnu.org; Sun, 17 Sep 2023 14:17:26 -0400 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3a7f4f7a8easo1810449b6e.2 for ; Sun, 17 Sep 2023 11:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694974643; x=1695579443; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=EeqCQJnSeksrnPTmx4jlQXh/3ifrcS5yzab9QoF2T0I=; b=a1argtT00wdyFeMbzPo22waK3UQjFHoy1OFBG0ctK01qDfNfur6lbhrLC+IVoHmh9Y eRUGm8KqWRLuTzCqSmg48GXNTNSzNEhMfvU1lq+tcJRu+TFEBIGz+GZk+o2IM/zlZeYm p0MJmXwY8RVnEE/gBwLXtgOyQEB2Idlhq+yoKo/UQUJiKrVCL+CpXly+U3KYN2QeU+vA U6oO+m5e9GPrkncj3fu4WdwsEn0ubRCEdyyZ31qmTA9U38X8iY6D+YfJ6ucr7MZHhVAy ud64P27u6amlqLV67Hxk97RZ7xBNWVqlPyZXIzhg4+4siXueqX/9H+0s47U2TWpYh0Xb 7MxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694974643; x=1695579443; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EeqCQJnSeksrnPTmx4jlQXh/3ifrcS5yzab9QoF2T0I=; b=f7F1hslj9XR5X2huxBl5FypOHR50uuEWnW2k9jrRcDcTTE90iuFrIu2+LRhbBl2RSH NK/vJ4v0wAy6r7YBJpzjR3TTyM5AVCGMyivGvep0glWNz8X7v1MtLmoRPehA++RhVEn9 3XaD8KzbjqfR6OwB0ngAs4owG6XNDwrlQa/atF5tgCXBezSQuFuBNh8EUsC498mB0Q3u FMkc+vNVAy4r31bbowh4kOtOzMCiEP3LSeAYBvZpzOT/DFctBQsKsT58/Y5X1FaL7Fn+ jfEgaDtYrn83JjM0MASC0xv6Xs8H5Mkf55bHU27S+d2rwSh9Au8Agv3f7SRNo2lKsuPn HK5g== X-Gm-Message-State: AOJu0YyVaVI0zmE2nbwOTRc2CHGhKaFeRMKNJdybJdTs2c53FXM7vIy3 s1mXJApYsNDI52jgQgMwJZ4DggfvSUk= X-Google-Smtp-Source: AGHT+IGm2pKHw4Mwe6tsuxBCqTu26WChOlVJ9sy7jV5I20yDSJuELKMnPyJUlEzGE9yjCKjhgHkd9g== X-Received: by 2002:a05:6808:21aa:b0:3a4:1f0f:d108 with SMTP id be42-20020a05680821aa00b003a41f0fd108mr9901614oib.46.1694974643185; Sun, 17 Sep 2023 11:17:23 -0700 (PDT) Received: from hurd (dsl-10-149-131.b2b2c.ca. [72.10.149.131]) by smtp.gmail.com with ESMTPSA id c20-20020a05620a165400b00767d8e12ce3sm2630079qko.49.2023.09.17.11.17.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 11:17:22 -0700 (PDT) From: Maxim Cournoyer Date: Sun, 17 Sep 2023 14:17:21 -0400 Message-ID: <87cyyg8y1a.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=maxim.cournoyer@gmail.com; helo=mail-oi1-x236.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 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 From unknown Fri Jun 13 10:50:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66057: (ice-9 match) allows invalid usages of ... or ..1 Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 17 Sep 2023 18:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66057 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Maxim Cournoyer , 66057@debbugs.gnu.org Received: via spool by 66057-submit@debbugs.gnu.org id=B66057.169497583532193 (code B ref 66057); Sun, 17 Sep 2023 18:38:02 +0000 Received: (at 66057) by debbugs.gnu.org; 17 Sep 2023 18:37:15 +0000 Received: from localhost ([127.0.0.1]:51415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhwdv-0008NA-4G for submit@debbugs.gnu.org; Sun, 17 Sep 2023 14:37:15 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:56115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhwdq-0008Ms-Sb for 66057@debbugs.gnu.org; Sun, 17 Sep 2023 14:37:13 -0400 Received: from [172.20.10.5] ([78.240.62.61]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.103]) with ESMTPSA (Nemesis) id 1MLiTI-1qzTUM0RFo-00Hh65; Sun, 17 Sep 2023 20:36:56 +0200 Message-ID: <862c98bacabb178176c779d4a982d6686d305aae.camel@abou-samra.fr> From: Jean Abou Samra Date: Sun, 17 Sep 2023 20:36:45 +0200 In-Reply-To: <87cyyg8y1a.fsf@gmail.com> References: <87cyyg8y1a.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-E/xzzPilieY16nfLj3d8" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Provags-ID: V03:K1:p7X4qXEurP+87vv3yHdXGDwaEBiX+PkNFLiLe5hjgpq5tdFwuHA M6IOedRrIUVBmCf2aVhmenVz0LcJS6b6QQzYa5RCHwpFxBGXUSotFiuoxsj9P6Njbj0S4+X KRk5ljXZjq8maChGmGWnzJ97QzCpoGspfscSC8RV7eNaH4fsozF3tZgEVN7d5NFg8wqChga vfHdpdmb+kIKrmKrQ76Hw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:YE0Ewwz8z1M=;Hh6kqHARafb4VlHs5ifE6R3MCcU oYaehtdHx55wDs5My7uOJlrHtP1aEdPo+w+FHF27vHUvAaW50btKPLH9tWw1b1yNVZF6uk7JJ APCLZ2uEZcWZAjUZUTX1odquWh2IvkclPW++/Q2IFkLtcgUn9dckoFN3bU716EcIDaiSuyb62 yz5JNFC9nm0KPdHnA8vnnaWz0w5NgtiOk0J/RaG6VIPpk/XScvD2goqOLXr5CtFfZhVe33j5D +jz9q2hJKi09IjGIKa9jcsmy/e1BlYvW7AVP4PvqrjlKRowWiyh1+TyWGhCDA8X/FHivIsXWB B+fydo8FmZH/3ryUdqq7s1Mjpj9EKswDJxK6UsiEt3RgkJgHyZtm/sL699TJ4lhsS4MoQhn7d NnjKDSXn/LuqWHEahfgwv9WVdDS0zw1ldLUYMlvshsiAMp7hVPNmGnR+BRwCGnlwdT9gAc4tv uX0EgJwYm0fL5esmDBORpj7mnpb9bJGY/0hYpPzoFTJ1XKQv5YlRoBSTTp/gG9fxTFTyDmgix fD8mnEIx6Hvw3OKVkn8qJdmAGYXHxZ4hHPgB0xrGAnGtfISuQXgcD1UVTuEFlj2HnOJMdE+FC 5tDybqztKFlNgCe150hOha/HS22rL09MrGAySsTBVVIqy/1lkZPxaT7S75djvyCceWfFyEo0L seifmjpr7IicspvLWtGepYVpL7tMIIsC5IiOHYqYC2rVzL60Lv521SMeRewuXhf8FURfime3m ZQh20T56BK5AIUcwTX9TyLTlV/djwYnWZyOwzRTbMrgfQIUBN9YM03vXduHULbEyohpAFio6j eDyCtl3Jh4u8bOIL0u1QX/G/8F3t0jlTtEN0EVTTCvMS6JpREPM3QaMf0fy9S2C4PeJ7skxnk Ww9W0e0WGaQNU0A== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-E/xzzPilieY16nfLj3d8 Content-Type: multipart/alternative; boundary="=-nmyPX1sEHO4UnDMKMopV" --=-nmyPX1sEHO4UnDMKMopV Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le dimanche 17 septembre 2023 =C3=A0 14:17 -0400, Maxim Cournoyer a =C3=A9c= rit=C2=A0: > Hi, >=20 > After attempting the following: >=20 > --8<---------------cut here---------------start------------->8--- > (match (string-split "./Bootloaders/Printer/Documentation/html" #\/) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (("." path ..1 "Documentation= " "html") For a start, where does that "..1" syntax come from? To my knowledge, no su= ch syntax is supported by Guile's pattern matcher, which AFAIK is the one desc= ribed 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. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (pk 'path path))) >=20 > =3D> ;;; (path "Bootloaders") >=20 > Expected (and works with '...'):=20 > ;;; (path "Bootloaders" "Printer") > --8<---------------cut here---------------end--------------->8--- >=20 > 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 a= nd syntax-case patterns either. --=-nmyPX1sEHO4UnDMKMopV Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Le dimanche 17 septembre 2023 =C3=A0 14:17 -0400,= Maxim Cournoyer a =C3=A9crit :
Hi,

After attempting the following:
=

--8<---------------cut here---------------start-----= -------->8---
(match (string-split "./Bootloaders/Printer/= Documentation/html" #\/)
      =             &nb= sp;            =   (("." 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 match= er, which AFAIK is the one described in SRFI-204.



<= div>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 vari= able.


&n= bsp;            = ;            &n= bsp;        (pk 'path path)))
<= div>
=3D> ;;; (path "Bootloaders")

Expected (and works with '...'):
;;; (path "Bootloader= s" "Printer")
--8<---------------cut here---------------en= d--------------->8---

and asking about it i= n #scheme or #guile, it seems the '..1' and '...'
patterns *m= ust* 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 pa= tterns either.
--=-nmyPX1sEHO4UnDMKMopV-- --=-E/xzzPilieY16nfLj3d8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZQdHPQAKCRCj8PYLiTOX /hvNAP0bQCI8nD9tmZMJauKabRLAhh+huksgcpS2T7gYcGPJnAD+MUr3tETkLALv l6S309Fl1cQ1yn+fx28i6vuu6yjuvwg= =x/RS -----END PGP SIGNATURE----- --=-E/xzzPilieY16nfLj3d8-- From unknown Fri Jun 13 10:50:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66057: (ice-9 match) allows invalid usages of ... or ..1 Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 18 Sep 2023 01:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66057 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Jean Abou Samra Cc: 66057@debbugs.gnu.org Received: via spool by 66057-submit@debbugs.gnu.org id=B66057.16949987829085 (code B ref 66057); Mon, 18 Sep 2023 01:00:02 +0000 Received: (at 66057) by debbugs.gnu.org; 18 Sep 2023 00:59:42 +0000 Received: from localhost ([127.0.0.1]:51697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi2c1-0002MS-Gr for submit@debbugs.gnu.org; Sun, 17 Sep 2023 20:59:42 -0400 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]:61706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi2bz-0002MB-5M for 66057@debbugs.gnu.org; Sun, 17 Sep 2023 20:59:40 -0400 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-773c03f2ac4so87105785a.3 for <66057@debbugs.gnu.org>; Sun, 17 Sep 2023 17:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694998765; x=1695603565; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=ifPaOPHY86FnynIop2PRhQwnNvqwQJQASyNF+DDhG44=; b=VIoyrLSI+b1rCe9PiHhJM1E4QYPsqNavOr33wsK8rkIZX/dt6dRBTPqb4Uq+TT3RDE OcGj8Z4i+k/yLANc7NLORdJk8tRgpkHQWFlyRuyIh/CwMEfNy3jt+qphmqWvJLYGa6+l vU57VX1T1NthIhI8llnNSsuGK8GuEe0ynQcjB0uiloRkZ6t4vuJ6xuq4+6Vr4QW3GMmK 8hS95jEorgr6VMz9fHUi4d675iItT6CK+x/5AMcS2ofIW71Ak+H1QwoBCuwqx+kd5jGA L6MU4fADAnFASVwcN77EslgLO9cxEPayLGWDQZcRB4k0pQbIqmpBPk6gtn2/eCJnBMD9 FAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694998765; x=1695603565; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ifPaOPHY86FnynIop2PRhQwnNvqwQJQASyNF+DDhG44=; b=esmxlwl4sOORdLD7eqRu4ozYbezUbjzEsrbnku10OzU5N6SxUbhKaAd7zCdrzNBH2N 1nbf+PgabaanHNgE3CibqG6a+X1XqGUihFldTEGM5POqgNAV3xSvz+q8QrCGLk1Wh+4f fFGhDMIwyBPxYeipkIeVjXW6w3cO653fSXsquWgaPdgNYFkkDdSLrPfNRyn56Ce2mO0/ us9f5kKMznbXI/N0bMsVkUHQegSDSn5Rh1M+BOzgw54vOgYNcwX+2+0oz2clsTtPDV98 6lDQITPteq74Pa4tC553JpeOYRjZgkB9ZNUK+6LzEtUbHchcc5srv3tZmcZ/fikptdmR Bw3A== X-Gm-Message-State: AOJu0YyUQZPfoxO4KhKF0HdtCgy1ok8bd3mT3LFJUpvUb2WKGaPgAsRJ qkKlQYNviSn3y/4+A7yd2nKPqWXY4Xs= X-Google-Smtp-Source: AGHT+IHxxeARdbjk9hRjhoTiwwSu1qpBJEutcYVzf0vEBZwbhL+Hy9Agw2CG03sgg2HfU9vcC0K8wg== X-Received: by 2002:a05:620a:2448:b0:770:6b7b:cd5f with SMTP id h8-20020a05620a244800b007706b7bcd5fmr9339030qkn.17.1694998765273; Sun, 17 Sep 2023 17:59:25 -0700 (PDT) Received: from hurd (dsl-10-149-131.b2b2c.ca. [72.10.149.131]) by smtp.gmail.com with ESMTPSA id w13-20020ae9e50d000000b0076f02a91fa8sm2767307qkf.52.2023.09.17.17.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 17:59:24 -0700 (PDT) From: Maxim Cournoyer References: <87cyyg8y1a.fsf@gmail.com> <862c98bacabb178176c779d4a982d6686d305aae.camel@abou-samra.fr> Date: Sun, 17 Sep 2023 20:59:23 -0400 In-Reply-To: <862c98bacabb178176c779d4a982d6686d305aae.camel@abou-samra.fr> (Jean Abou Samra's message of "Sun, 17 Sep 2023 20:36:45 +0200") Message-ID: <8734zc70us.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Jean Abou Samra writes: > Le dimanche 17 septembre 2023 =C3=A0 14:17 -0400, Maxim Cournoyer a =C3= =A9crit=C2=A0: >> Hi, >>=20 >> After attempting the following: >>=20 >> --8<---------------cut here---------------start------------->8--- >> (match (string-split "./Bootloaders/Printer/Documentation/html" #\/) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (("." 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 de= scribed > in SRFI-204. > > https://srfi.schemers.org/srfi-204/srfi-204.html It's mentioned in the Guile Reference manual; see info "(guile) Pattern Matching": --8<---------------cut here---------------start------------->8--- -- Scheme Syntax: match exp clause1 clause2 ... Match object EXP against the patterns in CLAUSE1 CLAUSE2 ... in the order in which they appear. Return the value produced by the first matching clause. If no clause matches, throw an exception with key =E2=80=98match-error=E2=80=99. Each clause has the form =E2=80=98(pattern body1 body2 ...)=E2=80=99. = Each PATTERN must follow the syntax described below. Each body is an arbitrary Scheme expression, possibly referring to pattern variables of PATTERN. The syntax and interpretation of patterns is as follows: patterns: matches: pat ::=3D identifier anything, and binds identifier | _ anything | () the empty list | #t #t | #f #f | string a string | number a number | character a character | 'sexp an s-expression | 'symbol a symbol (special case of s-expr) | (pat_1 ... pat_n) list of n elements | (pat_1 ... pat_n . pat_{n+1}) list of n or more | (pat_1 ... pat_n pat_n+1 ooo) list of n or more, each element of remainder must match pat_n+1 | #(pat_1 ... pat_n) vector of n elements | #(pat_1 ... pat_n pat_n+1 ooo) vector of n or more, each element of remainder must match pat_n+1 | #&pat box | ($ record-name pat_1 ... pat_n) a record | (=3D field pat) a ``field'' of an object | (and pat_1 ... pat_n) if all of pat_1 thru pat_n match | (or pat_1 ... pat_n) if any of pat_1 thru pat_n match | (not pat_1 ... pat_n) if all pat_1 thru pat_n don't match | (? predicate pat_1 ... pat_n) if predicate true and all of pat_1 thru pat_n match | (set! identifier) anything, and binds setter | (get! identifier) anything, and binds getter | `qp a quasi-pattern | (identifier *** pat) matches pat in a tree and binds identifier to the path leading to the object that matches pat ooo ::=3D ... zero or more | ___ zero or more | ..1 1 or more quasi-patterns: matches: qp ::=3D () the empty list | #t #t | #f #f | string a string | number a number | character a character | identifier a symbol | (qp_1 ... qp_n) list of n elements | (qp_1 ... qp_n . qp_{n+1}) list of n or more | (qp_1 ... qp_n qp_n+1 ooo) list of n or more, each element of remainder must match qp_n+1 | #(qp_1 ... qp_n) vector of n elements | #(qp_1 ... qp_n qp_n+1 ooo) vector of n or more, each element of remainder must match qp_n+1 | #&qp box | ,pat a pattern | ,@pat a pattern The names =E2=80=98quote=E2=80=99, =E2=80=98quasiquote=E2=80=99, =E2=80= =98unquote=E2=80=99, =E2=80=98unquote-splicing=E2=80=99, =E2=80=98?=E2=80= =99, =E2=80=98_=E2=80=99, =E2=80=98$=E2=80=99, =E2=80=98and=E2=80=99, =E2=80=98o= r=E2=80=99, =E2=80=98not=E2=80=99, =E2=80=98set!=E2=80=99, =E2=80=98get!=E2= =80=99, =E2=80=98...=E2=80=99, and =E2=80=98___=E2=80=99 cannot be used as pattern variables. --8<---------------cut here---------------end--------------->8--- > > 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 variabl= e. Unless I misread the doc, it should '..1' is a special case '...', which means "one or more" instead of "zero or more". > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (pk 'path path))) >>=20 >> =3D> ;;; (path "Bootloaders") >>=20 >> Expected (and works with '...'):=20 >> ;;; (path "Bootloaders" "Printer") >> --8<---------------cut here---------------end--------------->8--- >>=20 >> 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. OK! I hope it's just a bug in Guile that can be addressed then. Thanks for tipping in. --=20 Maxim From unknown Fri Jun 13 10:50:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66057: (ice-9 match) allows invalid usages of ... or ..1 Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 18 Sep 2023 09:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66057 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Maxim Cournoyer Cc: 66057@debbugs.gnu.org Received: via spool by 66057-submit@debbugs.gnu.org id=B66057.169502934011507 (code B ref 66057); Mon, 18 Sep 2023 09:29:02 +0000 Received: (at 66057) by debbugs.gnu.org; 18 Sep 2023 09:29:00 +0000 Received: from localhost ([127.0.0.1]:52093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiAYt-0002zX-Hk for submit@debbugs.gnu.org; Mon, 18 Sep 2023 05:28:59 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:35325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiAYp-0002zH-Kh for 66057@debbugs.gnu.org; Mon, 18 Sep 2023 05:28:58 -0400 Received: from [172.20.10.5] ([37.170.109.102]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.119]) with ESMTPSA (Nemesis) id 1MkIEJ-1rOPGw1kGP-00khgS; Mon, 18 Sep 2023 11:28:39 +0200 Message-ID: From: Jean Abou Samra Date: Mon, 18 Sep 2023 11:28:31 +0200 In-Reply-To: <8734zc70us.fsf@gmail.com> References: <87cyyg8y1a.fsf@gmail.com> <862c98bacabb178176c779d4a982d6686d305aae.camel@abou-samra.fr> <8734zc70us.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-rGZ8Gev+JltHwyt9jnxM" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Provags-ID: V03:K1:8RkUrbPbXqUbccLTWEfc0ic/lOqTuWaKQZvAdvTwloZtWCvDFfI M2XycC0mjMt6S7nhjBfT3P8eN+4LPJduk51hNx+O8h4dyS66MqdtBQDW6guy5+dYzl6W0Pr IvM6QxM/u9bzbpaRcrgS/72F/vzVeJPRJjoKbjKM52WByBiiXMyddO60bpcY2+iJ7sIFQhz hEIBHfzB77Iy7VvSgEkkA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:PZX8dmCu/CU=;ixShNpcua3AEHtprx44iBhkR+V8 iaQGVHpmOvWOxRSnIthgG2JUXZh5x5esutQ/OSKFOQaKjU+FkmLoyE+uPyThQZy7dp3Zen/Ww Oe54DqjsCUKuBEBrro67Ls9UTtneOmCH4jPGtCB8PJrKzHHChJmEDG0VLLMHHQB2w0elQDpTn icUa4b9unwq8WnaelFOrIBzXsTUcEWtBIM1+0aVBIfCt/sqqdtW4SG2FiUai97kTAIjeDOMFO ZoE/6YpbcJ+BBjRRkq11qEQqTomQLovpSLO8aHgKsxHNg0P8vNvN74jtb3T7Khv0xKUI5XI87 BrMKg/sqEQav47fX22YCtzVUL/gzm/Oqlyv3WwUoFYgiF7XHsnge/0Dt8vbN9ZBwV0dErCAgg lu1tuHRXA/QGdluyg25hl4cIAgNla0fDhZr9AL175CYR7g/FFnhaCCAzqO76iz/A2nBdluglX 7RNnSSKZ5pGruGB/myXtmHUTBdkYR8E7DRbcVzAAdziVOxaRH6dgVJzU6m97z7QkdIDRQdiW8 9qmjIrq1xrfGF7c+1EtXmKRlcN9WrabXD24Lj+1rIAWMqz8a6Ba47eTU86POAYJhixwRMj7Yb /4xIWQUBEfcKBBRNwW4qDTj0Os5U646z+0DcJShv+PeD3cChySEgItx/uPUmycu2cQeRgqFgP eTNw49VOz0/FnJVjD8oyfsLFVHgw0CaDSTa6FNjpYPjpUKSamkVOKWZxvJPkUBzN2zRbWsebd WKpBQTbb35MlVB2NI2CXfmYQ13fT9Eo1zfv5xz4TyvDxUz+ByGBNZm7PB6rA0rcbkhT28r7J5 CnFKdTHk0SY+LNe4RiJ9K9lNQz8nZX4kO/yT/q4tB7y5su9wNeKt/6H7SNFr4t7YORHQJaUZB 8hj6uktN49+ZDMQ== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-rGZ8Gev+JltHwyt9jnxM Content-Type: multipart/alternative; boundary="=-YSxfbF1v2fSWn/USEKOZ" --=-YSxfbF1v2fSWn/USEKOZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le dimanche 17 septembre 2023 =C3=A0 20:59 -0400, Maxim Cournoyer a =C3=A9c= rit=C2=A0: > It's mentioned in the Guile Reference manual; see info "(guile) Pattern > Matching": > >=20 > > 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 varia= ble. >=20 > Unless I misread the doc, it should '..1' is a special case '...', which > means "one or more" instead of "zero or more". OK, my bad, I didn't know that. You're right that "..1" is mistreated here,= it should be compiled as "one or more repetitions" but instead gets compiled a= s a pattern variable. That's a bug, indeed =E2=80=94 I believe the expected beh= avior is that "..1" behaves like "...", namely being allowed in the middle of a list. --=-YSxfbF1v2fSWn/USEKOZ Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Le dimanche 17 septembre 2023 =C3=A0 20:59 -0400,= Maxim Cournoyer a =C3=A9crit :
It's mentioned in the Guile Reference manual; see info "(guile) Pattern
Matching":

= 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 pa= ttern variable.

Unless I misread = the doc, it should '..1' is a special case '...', which
means= "one or more" instead of "zero or more".

=

OK, my bad, I didn't know that. You're right that "..1"= is mistreated here, it should be compiled as "one or more repetitions" but= instead gets compiled as a pattern variable. That's a bug, indeed =E2=80= =94 I believe the expected behavior is that "..1" behaves like "...", namel= y being allowed in the middle of a list.
--=-YSxfbF1v2fSWn/USEKOZ-- --=-rGZ8Gev+JltHwyt9jnxM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZQgYPwAKCRCj8PYLiTOX /gtWAQCBvcw1rQYuORYQNEfRAFP0ci3jKLXtibDjQWfqIrKxaQEA6w76gF/2UM70 BmYuGamm2zdteQB5yI7maKV7xrAQagk= =6Nln -----END PGP SIGNATURE----- --=-rGZ8Gev+JltHwyt9jnxM--