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, > > > (use-modules (system base pmatch)) > > (pmatch '(foo "bar") ((foo ,val) (write val) (newline))) > => "bar" > > > (use-modules (ice-9 match)) > > (match '(foo "bar") (`(foo ,val) (write val) (newline))) > => "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? I'm looking for opinions. > > Another example is sxml-match, which omits use of quasiquote. > I have written a variation of sxml-match. Should I keep the sxml-match > usage, which keeps it compatible with sxml-match, 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