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: Using "pcase" as part of names is inhelpful.
Date: Mon, 11 Dec 2017 09:31:21 -0500	[thread overview]
Message-ID: <jwv8te9wdnx.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: E1eNnB4-0005Sd-2f@fencepost.gnu.org

> Now we are adding other constructs that use patterns to destructure
> objects.  These constructs have nothing to do with selecting among
> cases.  Thus, 'pcase' in their names makes for misleading names.

Indeed, their "pcase-" is the name of the package but it can be confused
with the name of the `pcase` macro.

> We should give the new constructs names that fit them without a
> distracting element.  What would be good new names?
> We could use 'plet' and 'plambda'.  Or 'pattern-let' and 'pattern-lambda'.

For pcase-dolist, there's little doubt in my mind that we should call it
`dolist`.  For pcase-let, I'd also like to call it `let`, tho there are
some technical difficulties there (it would probably involve renaming
the current `let` special form and providing an initial "dummy"
definition of `let` as an alias for that new name during bootstrap
until we get to the point where we can override it with pcase's
version).

OTOH I'm not so sure we want to rename pcase-lambda to `lambda` for
the simple reason that I'm not completely satisfied with `pcase-lambda`
and I don't see a way that would satisfy me without making it
"incompatible" with `lambda` (the main issue being that &optional and
&rest are themselves limited forms of pattern matching, so we'd have to
either add them to pcase patterns or find some other way to combine the
two).

Given that there are currently very few uses of pcase-lambda, I'm
pretty happy living with a suboptimal name like `pcase-lambda`.

> We could follow the example of Common Lisp 'destructuring-bind', to
> create 'destructuring-let' and 'destructuring-lambda'.

That would make it sound like it will use CL-style patterns rather than
pcase-style patterns.


        Stefan




      parent reply	other threads:[~2017-12-11 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-09 22:00 Using "pcase" as part of names is inhelpful Richard Stallman
2017-12-09 22:35 ` John Wiegley
2017-12-09 23:01   ` Paul Eggert
2017-12-10 21:44   ` Richard Stallman
2017-12-10  1:07 ` Robert Weiner
2017-12-10 21:45   ` Richard Stallman
2017-12-11 14:31 ` Stefan Monnier [this message]

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=jwv8te9wdnx.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.