unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Nicolas Petton <nicolas@petton.fr>, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] map 988d721: Add a pcase pattern for maps and `map-let' based on it
Date: Sun, 07 Jun 2015 20:36:22 +0200	[thread overview]
Message-ID: <87zj4bfjrt.fsf@web.de> (raw)
In-Reply-To: <jwv6173w19r.fsf-monnier+emacsdiffs@gnu.org> (Stefan Monnier's message of "Thu, 04 Jun 2015 18:39:49 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> This said, if the main case where the quote would be needed is when KEY
> is a (non-keyword) symbol, then it's probably worth the extra
> flexibility since you could say that an element of the form SYMBOL is
> treated as equivalent to ('SYMBOL SYMBOL), so the extra quote will be
> very rarely needed.

Now that this has been finished, we should add to the doc what KEY _is_
in the "elements of the form (KEY PAT)", and how it is compared
(e.g. say it's interpreted as an expression to be evaluated, and
compared with "equal" in the alist case).

Perhaps we should also say that only one occurrence of KEY is tested in
the alist case (is that true?), e.g.

(pcase '((1 . 11) (1 . 9))
  ((map (1 (and x (pred (> 10))))) x)
  (_ 'not-found))

gives not-found, not 9 (which would also make sense).


Thanks,

Michael.



  parent reply	other threads:[~2015-06-07 18:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150602201956.22733.21800@vcs.savannah.gnu.org>
     [not found] ` <E1YzsfE-0005vH-4d@vcs.savannah.gnu.org>
2015-06-03  1:06   ` [Emacs-diffs] map 988d721: Add a pcase pattern for maps and `map-let' based on it Stefan Monnier
2015-06-04 20:18     ` Nicolas Petton
2015-06-04 22:39       ` Stefan Monnier
2015-06-05  8:09         ` Nicolas Petton
2015-06-07 18:36         ` Michael Heerdegen [this message]
2015-06-08 14:16           ` Stefan Monnier
2015-06-08 15:34             ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87zj4bfjrt.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nicolas@petton.fr \
    /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 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).