[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Instead of pcase
|
From: |
Eli Zaretskii |
|
Subject: |
Re: Instead of pcase |
|
Date: |
Thu, 16 Nov 2023 21:19:48 +0200 |
> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Thu, 16 Nov 2023 18:44:10 +0100
>
> "T.V Raman" <raman@google.com> writes:
>
> > I recently tried to understand some of the completion code; --
> > specifically, completion-at-point, and immediately hit the pcase wall
> > and gave up --- my lack of understanding of pcase made that code in
> > Emacs Core read like line-noise.
>
> But that pcase form is only performing trivial destructuring.
If it does, then the node "Destructuring with pcase Patterns" Needs
Workâ˘, because if you try to compare this fragment from
completion-at-point:
(pcase res
(`(,_ . ,(and (pred functionp) f)) (funcall f))
(`(,hookfun . (,start ,end ,collection . ,plist))
with the example in the manual that explains destructuring, viz.:
(pcase my-list
(`(add ,x ,y) (message "Contains %S and %S" x y)))
you will, I hope, see the difficulty of a newcomer to 'pcase' in
understanding how the code in completion-at-point is "only
destructuring". IOW, if this code is "just destructuring", we don't
do a good-enough job of explaining that in the manual.
- Instead of pcase, Richard Stallman, 2023/11/15
- Re: Instead of pcase, Dmitry Gutov, 2023/11/16
- Re: Instead of pcase, T.V Raman, 2023/11/16
- Re: Instead of pcase, Philip Kaludercic, 2023/11/16
- Re: Instead of pcase, T.V Raman, 2023/11/16
- Re: Instead of pcase, Richard Stallman, 2023/11/17
- Re: Instead of pcase, Michael Heerdegen, 2023/11/19
- Re: Instead of pcase, Barry Fishman, 2023/11/19
- Re: Instead of pcase, Dmitry Gutov, 2023/11/19
- Re: Instead of pcase, Eric Abrahamsen, 2023/11/19