From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.user Subject: Re: Macro id-memv??, workings of tripple dot Date: Fri, 15 Mar 2024 09:03:48 +0100 Message-ID: <58f1231fa7ae3b9e14e0da428c9ead4d21a87394.camel@abou-samra.fr> References: <16d24ba3-8a75-4589-a687-cfce981c92f2@posteo.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-tgfbnSyZ/JlMDkTQ2/mh" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28290"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) To: Zelphir Kaltstahl , Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Mar 15 09:04:36 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rl2YO-00079u-6G for guile-user@m.gmane-mx.org; Fri, 15 Mar 2024 09:04:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rl2Xn-0005UR-O9; Fri, 15 Mar 2024 04:03:59 -0400 Original-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 1rl2Xl-0005U8-MD for guile-user@gnu.org; Fri, 15 Mar 2024 04:03:57 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rl2Xj-0003Mv-3I for guile-user@gnu.org; Fri, 15 Mar 2024 04:03:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=abou-samra.fr; s=s1-ionos; t=1710489830; x=1711094630; i=jean@abou-samra.fr; bh=sEXVDg4YegUqlb4tIy6HxmHPqIxNDmkHUfeQGDDOURY=; h=X-UI-Sender-Class:Subject:From:To:Date:In-Reply-To:References; b=yzzGncubsujc06P22HbjKjPgQidZmlxnf5viKoE7cZWyvcbxXHM89wPc3pF82iAr bvliD+GBq2qHPguLp1L6PAQ8CWbTABEk4FfE7F5VK1++tjELK3WdtqlBx9BG+GwN/ 6nW4625uOw9G72pK37NauwUkItRRbVwj5ke4b2FSgbLG+4kWTErnsfAaRtlTU2C4C S3gLQlc47Vntp9xHw60xjKbee+xD6OEi/jXaC1UzE5MRqC2P3ZA4InSZ5643Kld1v BEIwhekpKIW3W7E+JK8MVuZLiBkpGferwE56fXDv5PJQ3R4WVdvrhrf5RxCjG94ME RFBbWGio3FSVBYa5WA== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Original-Received: from [192.168.1.16] ([83.202.85.244]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.103]) with ESMTPSA (Nemesis) id 1Md6V1-1rCo7S436Z-00aCPR; Fri, 15 Mar 2024 09:03:50 +0100 In-Reply-To: <16d24ba3-8a75-4589-a687-cfce981c92f2@posteo.de> Autocrypt: addr=jean@abou-samra.fr; prefer-encrypt=mutual; keydata=mDMEYz8qHRYJKwYBBAHaRw8BAQdAKa699V3Pc3AOAg40hnai7Ljs1uAOxkeopSA7uz+TN/q0JEplYW4gQWJvdSBTYW1yYSA8amVhbkBhYm91LXNhbXJhLmZyPoiTBBMWCgA7FiEEme0ysZyhsgbwY8wZo/D2C4kzl/4FAmM/Kh0CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQo/D2C4kzl/5MjQEAzHgLjZqtPK4nM5d4a+c03tUmYTKsGnfiHYPbSwD7V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QmWrGlXgBU0l06MwrZlhf VypCBZ+4u115AvvkN18OWWXzmDP/KKE5m+HtnERWNsY4wsCbjbnnB+Us6nVJjHhZArWbyFYuP jcS8qKagU7ScfcprNdkzFyne6cjSwS+LRphodpm+w2mIr/rOON3ghNCKIJFD07GLMxlB2IKEK hBWmh+aMKXCExk+XiJ3+xYP1+MH/ZKRqGvlnynxLRlNiYEB6YZcylQ4Nmbys8IOkQmC7MhArw XkH0BF9Awh1RpmL7bbjMD6E3kcJRqNxy8xe5A6vfIYqhz/BQhFObnE= Received-SPF: pass client-ip=212.227.126.135; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19468 Archived-At: --=-tgfbnSyZ/JlMDkTQ2/mh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > My question is: Do the ... in the case >=20 > ((test id _kt _kf) _kt) ... >=20 > produce one case for each identifier in the list? Yes, they do. > I am guessing that this is what they do. However, they are mentioned as l= iterals in the inner syntax-rules, No, they aren't. The (id ...) form is expanded by the outer syntax-rules form, as part of expanding the id-memv?? macro. They don't remain in the expanded result. For example, if you call (id-memv?? foo (foo bar baz) kt kf) the expansion will look like (let-syntax ((test (syntax-rules (foo bar baz) ((test foo _kt _kf) _kf) ((test bar _kt _kf) _kf) ((test baz _kt _kf) _kf) ((test otherwise _kt _kf) _kf)))) (test foo kt kf)) > so I was thinking the expansion will simply put literally three dots ther= e,=20 > instead of understanding the three dots to mean "for each of the ids". >=20 > And also I still am unsure about whether the three dots work like this at= all. They do. > When one puts the ... after a compound expression, that contains the thin= g, that=20 > the ... were after in the matching -- in this case they were after id, an= d id is=20 > contained in the compound expression (test id _kt _kf) _kt) -- does that = make=20 > the compound expression be generated for each thing matched? Yes, see: (syntax->datum (with-syntax ((simple #'a) ((compound ...) #'(b c d)) (((nested-compound ...) ...) #'((e f g) (h i j)))) #'(((simple compound nested-compound) ...) ...))) =E2=87=92 (((a b e) (a c f) (a d g)) ((a b h) (a c i) (a d j))) > But if this is the case, then I might be misunderstanding the Guile docs = at=20 > https://www.gnu.org/software/guile/manual/html_node/Syntax-Rules.html: >=20 > "Instances of a pattern variable in the template must be followed by an e= llipsis." Note that this is talking about the patterns, not the syntax forms. But it is slightly misleading: also in patterns it is perfectly possible to do something like (syntax->datum (with-syntax ((((a b) ...) #'((1 2) (3 4) (5 6)))) #'((a ...) . (b ...)))) =E2=87=92 ((1 3 5) 2 4 6) Note the pattern ((a b) ...) An ellipsized pattern is recognized by the ellipsis, but it doesn't need to follow a simple pattern variable, it can follow a nested pattern. Best, Jean --=-tgfbnSyZ/JlMDkTQ2/mh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZfQA5AAKCRCj8PYLiTOX /pXNAQD2ymH92Ab6JnAPNYGddoJZABAPYD4L6us8LKHUbHAm3QD/ZGMrYejWGP47 C3YKeUdJnlyjXNoBFaQbr3APqjZb2AE= =y0zh -----END PGP SIGNATURE----- --=-tgfbnSyZ/JlMDkTQ2/mh--