unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* syntax taste: use of unquote in macros
@ 2020-03-29 15:11 Matt Wette
  2020-03-29 22:07 ` Zelphir Kaltstahl
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Matt Wette @ 2020-03-29 15:11 UTC (permalink / raw)
  To: Guile User

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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-31 16:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-29 15:11 syntax taste: use of unquote in macros Matt Wette
2020-03-29 22:07 ` Zelphir Kaltstahl
2020-03-30 10:34   ` tomas
2020-03-30 23:43     ` Matt Wette
2020-03-31  9:19       ` tomas
2020-03-30 13:07 ` Arne Babenhauserheide
2020-03-31 16:56 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).