[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: syntax taste: use of unquote in macros

From: Matt Wette
Subject: Re: syntax taste: use of unquote in macros
Date: Mon, 30 Mar 2020 16:43:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 3/30/20 3:34 AM, address@hidden wrote:
On Mon, Mar 30, 2020 at 12:07:07AM +0200, Zelphir Kaltstahl wrote:
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 ,).   For example,
[pmatch vs. match]

I'm not sure where I first read about pmatch doing the quasiquote
internally automatically and I of course had already forgotten about it,

I didn't even know about `pmatch'. Is it supposed to be equivalent
to `match' (except that outer quasiquote, that is)?

With the caveat that I don't have much of a stylistic feeling for
Scheme, I'd clearly prefer `match': the writer has the choice of
quote or quasiquote, as appropriate to the case -- and the reader
sees what's going on (after all, quote and quasiquote are "low
weight" primitives: everyone more or less knows what they do.

But perhaps I misunderstood what you're after?

-- tomás

The other thing about match that is attractive is that use of
quasiquote+unquote is "reflexive" (or maybe self-adjoint?)
in the following sense:

'(foo "bar") => (match-lambda (`(foo ,val) `(foo ,val))) => '(foo "bar")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]