unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* pcase-dolist
@ 2015-07-08 12:20 Michael Heerdegen
  2015-07-08 13:54 ` pcase-dolist Stefan Monnier
  0 siblings, 1 reply; 34+ messages in thread
From: Michael Heerdegen @ 2015-07-08 12:20 UTC (permalink / raw)
  To: Emacs Development

Hello,

I was recently bitten by unexpected behavior of `pcase-dolist'.
Like `pcase-let' (which is used internally by `pcase-dolist'), AFAICT it
assumes that the pattern always matches, e.g.

(pcase-dolist ((and x (pred < 0)) '(-1 0 1 2))
  (message "%s" x))

prints all members of the sequence.

Apart from the question whether this semantic is useful: with the
current semantic, a name that includes "case" is irritating considering
such a behavior.  Maybe "pdolist" (and "plet", "plet*") would be better
names?

Anyway, an idea that came to my mind more than once: `when-let',
`if-let' should really be `pcase-when-let' , `pcase-if-let'.  They would
be much more useful than the plain versions I think.

Then `pcase-dolist' could be reimplemented using `pcase-when-let'.


Michael.



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

end of thread, other threads:[~2015-10-17 13:31 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 12:20 pcase-dolist Michael Heerdegen
2015-07-08 13:54 ` pcase-dolist Stefan Monnier
2015-07-08 17:32   ` pcase-dolist Michael Heerdegen
2015-07-08 18:26     ` pcase-dolist Tassilo Horn
2015-07-08 21:27       ` pcase-dolist Stefan Monnier
2015-07-09  6:05         ` pcase-dolist Tassilo Horn
2015-07-09  9:55           ` pcase-dolist Thierry Volpiatto
2015-07-09 10:17             ` pcase-dolist Tassilo Horn
2015-07-09 12:19               ` pcase-dolist Thierry Volpiatto
2015-07-09 13:34                 ` pcase-dolist Tassilo Horn
2015-07-09 13:40                   ` pcase-dolist Thierry Volpiatto
2015-07-09 19:26           ` pcase-dolist Stefan Monnier
2015-07-09 20:27             ` pcase-dolist Michael Heerdegen
2015-07-10 18:51               ` pcase-dolist Stefan Monnier
2015-10-12 11:27               ` pcase-setq (was: pcase-dolist) Michael Heerdegen
2015-10-12 11:54                 ` pcase-setq Michael Heerdegen
2015-10-12 12:01                 ` pcase-setq (was: pcase-dolist) Nicolas Petton
2015-10-12 12:36                   ` pcase-setq Michael Heerdegen
2015-10-12 12:49                   ` Semantic of pcase `seq' and `map' patterns (was: pcase-setq) Michael Heerdegen
2015-10-12 13:41                     ` Semantic of pcase `seq' and `map' patterns Michael Heerdegen
2015-10-12 13:55                       ` Nicolas Petton
2015-10-12 14:02                         ` Michael Heerdegen
2015-10-17 12:21                           ` Michael Heerdegen
2015-10-17 13:31                             ` Nicolas Petton
2015-10-12 13:50                     ` Semantic of pcase `seq' and `map' patterns (was: pcase-setq) Nicolas Petton
2015-10-13  0:59                 ` pcase-setq Stefan Monnier
2015-10-13 13:52                   ` pcase-setq Michael Heerdegen
2015-10-13 14:02                     ` pcase-setq Michael Heerdegen
2015-10-13 15:52                       ` pcase-setq Michael Heerdegen
     [not found]                         ` <jwvfv1eboo8.fsf-monnier+emacs@gnu.org>
     [not found]                           ` <87d1wh36as.fsf@web.de>
2015-10-14 15:49                             ` pcase-setq Stefan Monnier
2015-07-10 14:44             ` pcase-dolist Tassilo Horn
2015-07-10 19:04               ` pcase-dolist Stefan Monnier
2015-07-08 19:44     ` pcase-dolist Artur Malabarba
2015-07-08 20:50       ` pcase-dolist Michael Heerdegen

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