From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Re: syntax taste: use of unquote in macros Date: Mon, 30 Mar 2020 00:07:07 +0200 Message-ID: <91a7553d-2f04-4319-3437-fbe05cddde47@posteo.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="68534"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 To: Matt Wette , Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Mar 30 00:07:39 2020 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 1jIg5i-000Hi9-IX for guile-user@m.gmane-mx.org; Mon, 30 Mar 2020 00:07:38 +0200 Original-Received: from localhost ([::1]:42142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIg5h-0003VQ-61 for guile-user@m.gmane-mx.org; Sun, 29 Mar 2020 18:07:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55643) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIg5J-0003SP-9H for guile-user@gnu.org; Sun, 29 Mar 2020 18:07:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIg5I-0006J0-42 for guile-user@gnu.org; Sun, 29 Mar 2020 18:07:13 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:55155) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jIg5H-0006F2-KH for guile-user@gnu.org; Sun, 29 Mar 2020 18:07:12 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 9179B160061 for ; Mon, 30 Mar 2020 00:07:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1585519628; bh=i7rCnfZ1uHa8H7vX1Z1Z05OG5HhEx/z9d23iAnF7eiU=; h=Subject:To:From:Date:From; b=g5nso4dGM/yJEqbX0/L+TVrmap9WtCmij2pjno2t5wlCDnvj0vBeYc+ml4e8RBAwL AKaReZkzYh4hxHuAMEkqVUYXdCsd1n8U7A5+mSxjKNIL4Dre84GWIP17NN8XDYPKRN i4yZNw5DXrM7h6J/MImwkZjZM2AZZUhwhsx1S6zW0sKkmA85guacSjlFSjBoh9gSpN Emif3PMUtmH7FkbA3+XRPt5WB4UDty7ismyHdc/damXvLxYSTaDHwCc7/aOAtLzL/e SRvnYc5TSxwb4bbkwPi6DsJTzlDY6fjoRZfsfK6Olf9n+v7vlBHze33n9ByjJczqY+ gSU3o3vWDivzw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 48r8p37350z6tm6; Mon, 30 Mar 2020 00:07:07 +0200 (CEST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.67.36.65 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.lisp.guile.user:16354 Archived-At: On 3/29/20 5:11 PM, Matt Wette wrote: > Hi All, > > I'm not sure if you know about this, but there is a discrepancy in the > way some folks define macros to use unquote (aka ,).=C2=A0=C2=A0 For ex= ample, > > > (use-modules (system base pmatch)) > > (pmatch '(foo "bar")=C2=A0 ((foo ,val)=C2=A0 (write val) (newline))) > =3D> "bar" > > > (use-modules (ice-9 match)) > > (match '(foo "bar")=C2=A0 (`(foo ,val)=C2=A0 (write val) (newline))) > =3D> "bar" > > Note the difference in the use of quasiquote (aka `) in the pattern > for (foo ,val): match syntax uses it, pmatch does not. > In Scheme, quasiquote and unquote always come together. > > Is pmatch syntax in bad taste?=C2=A0 I'm looking for opinions. > > Another example is sxml-match, which omits use of quasiquote. > I have written a variation of sxml-match.=C2=A0 Should I keep the sxml-= match > usage, which keeps it compatible with sxml-match,=C2=A0 or adopt that > used by (ice-9 match)? > > Matt Hi Matt! I'm not sure where I first read about pmatch doing the quasiquote internally automatically and I of course had already forgotten about it, until I read your e-mail. I remember though: When I read about it, I thought something like: "Ehhh? That's confusing. Everywhere else you have to quasiquote to unquote, but in pmatch it's different. Easy to forget that and I need to remember more. I would not mind having to write a simple quasiquote myself." So, with my limited experience, I would definitely vote for the, in my opinion more natural way, to have the user write the quasiquote, instead of doing that internally. It's not saving that much time or writing really. I understand the idea, that "if it is always done anyway, one could save the user some typing of the same thing over and over again", but in my opinion it is not worth it to deviate from, what one would expect without knowing about this behavior. Regards, Zelphir