[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] map 988d721: Add a pcase pattern for maps and `map-let

From: Michael Heerdegen
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <address@hidden> 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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]