Discussion:
[Emacs-diffs] fix/bug-3133-pcase-doc 1181796 01/13: do ‘s/UPattern/U-pattern/g’, ‘s/QPattern/Q-pattern/g’
(too old to reply)
Stefan Monnier
2018-05-12 15:01:16 UTC
Permalink
do ‘s/UPattern/U-pattern/g’, ‘s/QPattern/Q-pattern/g’
Hmm... I think this text should be changed to use the term "pattern" for
"U(-)pattern". I did that in pcase's docstring when I introduced the
pcase-defmacro.


Stefan
Thien-Thi Nguyen
2018-05-13 17:46:17 UTC
Permalink
() Stefan Monnier <***@IRO.UMontreal.CA>
() Sat, 12 May 2018 11:01:16 -0400

Hmm... I think this text should be changed to use the term
"pattern" for "U(-)pattern".

I've come around to this pov as well. See latest commits.

WRT Q-pattern:

My understanding is that `QPAT is an "extension" in deed (since
it's implemented via ‘pcase-defmacro’), but perhaps "innate" in
spirit. I moved the "structural pattern" stuff to the

(pcase-defmacro \` (qpat) ...)

docstring and added a comment in ‘pcase--make-docstring’ (but
have not changed any code). I think if we can get `QPAT to be
first in the extensions docs (in *Help*), this would satisfy
both the maintainability best practice (keep documentation near
its code) and the user experience best practice (good flow,
ordering).

What do people think?
--
Thien-Thi Nguyen -----------------------------------------------
(defun responsep (query)
(pcase (context query)
(`(technical ,ml) (correctp ml))
...)) 748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502
Michael Heerdegen
2018-05-15 15:40:22 UTC
Permalink
[...] I think if we can get `QPAT to be first in the extensions docs
(in *Help*), this would satisfy both the maintainability best practice
(keep documentation near its code) and the user experience best
practice (good flow, ordering).
What do people think?
Absolutely agreed.

Now that the result of `pcase--make-docstring' grows longer and longer,
maybe the naive `mapatoms' is not so nice anyway, it could need some
better order/ some structure.


Michael.
Stefan Monnier
2018-05-15 18:29:33 UTC
Permalink
Post by Michael Heerdegen
Now that the result of `pcase--make-docstring' grows longer and longer,
maybe the naive `mapatoms' is not so nice anyway, it could need some
better order/ some structure.
Agreed.


Stefan

Loading...