unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* pcase: Semantics of atom QPATS
@ 2018-06-10  0:40 Michael Heerdegen
  2018-06-11 14:09 ` Stefan Monnier
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2018-06-10  0:40 UTC (permalink / raw)
  To: Emacs Development

Hello,

isn't it strange that the pattern '.7 matches .7, but `.7 causes an
error when used?

Or

(pcase '(.7 1)
  ('(.7 1) t))
==> t

but

(pcase '(.7 1)
  (`(.7 ,_) t))
|-- error: `--pcase-macroexpander: Unknown QPAT: 0.7

IMO the analogy to the list of self-quoting atoms (strings, keywords,
integers - I'm all for that) is misguided here - something implicitly
quoted in a backquoted pattern (i.e. something that is not unquoted)
should behave like quoted with `'' (i.e. transformed into an `eq' test),
everything else feels inconsistent.

This corner case actually bit me when I was trying to refactor a piece
of code that included the atom .7 (as you might have guessed) with
el-search.


Thanks,

Michael.



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

end of thread, other threads:[~2018-06-17 13:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-10  0:40 pcase: Semantics of atom QPATS Michael Heerdegen
2018-06-11 14:09 ` Stefan Monnier
2018-06-11 14:45   ` Drew Adams
2018-06-11 15:24     ` Stefan Monnier
2018-06-11 20:53   ` Michael Heerdegen
2018-06-13  3:41   ` Michael Heerdegen
2018-06-13 12:52     ` Stefan Monnier
2018-06-16  4:03       ` Michael Heerdegen
2018-06-16  6:57         ` Eli Zaretskii
2018-06-16  7:32           ` Michael Heerdegen
2018-06-16  7:49             ` Eli Zaretskii
2018-06-17 13:35               ` Michael Heerdegen
2018-06-16 13:42             ` Noam Postavsky
2018-06-16 12:57           ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).