all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: pcase-if-let?
Date: Thu, 29 Mar 2018 00:53:29 -0400	[thread overview]
Message-ID: <jwvd0znqykm.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 871sg3ijgf.fsf@web.de

> Yes, your are right with everything, the names are nonsense.  I guess we
> are still in some kind of intermediate state - AFAIK Stefan hopes to
> integrate the pcase stuff more into Emacs innards some day.  Dealing
> with these wide problems is not what I want to do here.  For now, I just
> want to be consistent with the existing naming scheme.

FWIW, I'm a bit worried about this case: it's not like this pcase-if is
a "pcase version of some existing construct", so if we ever want to get
rid of the "pcase-" prefix on it, we'll have to invent a new name
for it.

IOW it's different from pcase-let and pcase-dolist which are
designed to be "replacements" for let/dolist.


        Stefan


PS: Regarding the "unorthodox" shape of the pcase construct, you could
generate an expression of the form (pcase (list E1 E2 ...) ((list P1 P2
...) THEN) (_ ELSE)).  It would be a good opportunity to try and fix
pcase so that it generates efficient code for such uses (i.e. it
shouldn't build the list only to then check it).  There are already uses
of pcase that would benefit from it, typically for smie-rules-function
where we often do (pcase (cons kind token) ...).




  parent reply	other threads:[~2018-03-29  4:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 23:20 pcase-if-let? Michael Heerdegen
2018-03-28 23:54 ` pcase-if-let? Davis Herring
2018-03-29  0:21   ` pcase-if-let? Michael Heerdegen
2018-03-29  3:46     ` pcase-if-let? Michael Heerdegen
2018-03-29  4:14       ` pcase-if-let? Drew Adams
2018-03-29  4:39         ` pcase-if-let? Michael Heerdegen
2018-03-29  4:49           ` pcase-if-let? Drew Adams
2018-03-29  4:53           ` Stefan Monnier [this message]
2018-03-29  5:24             ` pcase-if-let? Michael Heerdegen
2018-03-29 11:59               ` pcase-if-let? Stefan Monnier
2018-03-30  1:52                 ` pcase-if-let? Michael Heerdegen
2018-03-30  4:07                   ` pcase-if-let? Drew Adams
2018-03-30  5:09                     ` pcase-if-let? Michael Heerdegen
2018-03-30 15:07                       ` pcase-if-let? Drew Adams
2018-03-30 23:22                         ` pcase-if-let? Michael Heerdegen
2018-04-17 20:26           ` pcase-if-let? Nathan Moreau
2018-04-17 21:04             ` pcase-if-let? Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd0znqykm.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.