[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] fix/bug-31311-pcase-doc e436b49 04/16: for structural / Q-
From: |
Thien-Thi Nguyen |
Subject: |
[Emacs-diffs] fix/bug-31311-pcase-doc e436b49 04/16: for structural / Q-pattern, replace "atom" w/ SYMBOL, INTEGER, STRING |
Date: |
Sun, 13 May 2018 13:16:34 -0400 (EDT) |
branch: fix/bug-31311-pcase-doc
commit e436b493889598628392278cd24a97076c76ff72
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>
for structural / Q-pattern, replace "atom" w/ SYMBOL, INTEGER, STRING
This suggests a discussion on the different idempotent ways
to specify the various self-quoting objects:
INTEGER ≡ 'INTEGER ≡ `INTEGER
STRING ≡ 'STRING ≡ `STRING
KEYWORD ≡ 'KEYWORD ≡ `KEYWORD
(Maybe.)
---
doc/lispref/control.texi | 11 ++++++++---
lisp/emacs-lisp/pcase.el | 6 ++++--
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index f6bff52..eb0728e 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -534,9 +534,14 @@ Matches if @var{expval} is a vector of length @var{m} whose
@address@hidden(@var{m}-1)}th elements match @var{qpattern1},
@var{qpattern2} @dots{} @var{qpatternm}, respectively.
address@hidden @var{atom}
-Matches if corresponding element of @var{expval} is
address@hidden to the specified @var{atom}.
address@hidden @var{symbol}
address@hidden @var{keyword}
address@hidden @var{integer}
address@hidden @var{string}
+Matches if the corresponding element of @var{expval} is
address@hidden to the specified object.
+Note that, aside from @var{symbol}, this is the same set of
+self-quoting types that are acceptable as a U-pattern.
@item ,@var{upattern}
Matches if the corresponding element of @var{expval}
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 398bc4d..97d503a 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -920,8 +920,10 @@ QPAT can take the following forms:
[QPAT1 QPAT2..QPATn] matches a vector of length n and QPAT1..QPATn match
its 0..(n-1)th elements, respectively.
,PAT matches if the pcase pattern PAT matches.
- ATOM matches if the object is `equal' to ATOM.
- ATOM can be a symbol, an integer, or a string."
+ SYMBOL matches if the object is `equal' to SYMBOL.
+ KEYWORD likewise for KEYWORD.
+ INTEGER likewise for INTEGER.
+ STRING likewise for STRING."
(declare (debug (pcase-QPAT)))
(cond
((eq (car-safe qpat) '\,) (cadr qpat))
- [Emacs-diffs] fix/bug-31311-pcase-doc updated (b93c07e -> 2eb044b), Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 3a1f07e 01/16: (docstring) do ‘s/applied to/called on/g’, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc c5076a2 03/16: convert a few "the @foo{bar}" into simply "@foo{bar}", Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc e436b49 04/16: for structural / Q-pattern, replace "atom" w/ SYMBOL, INTEGER, STRING,
Thien-Thi Nguyen <=
- [Emacs-diffs] fix/bug-31311-pcase-doc 26b1fa0 06/16: say ‘doc’ instead of ‘docstring’; move before ‘&rest’, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 75ed6d2 05/16: use ‘EXPVAL’ in ‘pcase-defmacro’ et al docstrings, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 24b02d2 08/16: (docstring) zonk inline Issue, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 5bbbcf4 02/16: move table of PREDFUN forms into ‘pred’ item; refine, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 42ee34d 07/16: add comment: pine for ‘backquote’ first in generated docs; nfc, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 5fc0f24 11/16: mention unsuitability of ‘t’, ‘nil’ as SYMBOL pattern, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 352c1de 12/16: (docstring) small refinements, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc df05494 10/16: objects are self-quoting, not types, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 1c84726 14/16: move ‘app’ to immediately follow ‘pred’, Thien-Thi Nguyen, 2018/05/13
- [Emacs-diffs] fix/bug-31311-pcase-doc 381ea05 09/16: (docstring) split middle, Thien-Thi Nguyen, 2018/05/13