emacs-devel
[Top][All Lists]
Advanced

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

Re: Question on pcase


From: Michael Heerdegen
Subject: Re: Question on pcase
Date: Thu, 22 Oct 2015 23:19:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Hello Oleh,

> To be frank, I'm not a fan of `pcase', and really prefer a "for dummies"
> coding style. But if it makes other people feel more productive, I'm
> fine with it as long as I can read and debug it.
>
> One piece that I'm missing currently is the ability to eval a `pcase'
> pattern.

Did you try to `macroexpand' a pcase form?  The result is readable,
though a bit long.

Note that `pcase' doesn't set variables, it is a binding construct.

Since the "matching" part and the "binding" part aren't separate, but
binding happens as a side effect while matching, your approach to
understand the thing seems not good to me.

IME the best way to transform pcase expressions into a readable form is
to learn to read them.  I can only advertise to give it a try.  A good
starting point is

   (info "(elisp) Pattern matching case statement")

(can be improved...)

But I totally understand if you don't want to learn it.  FWIW I never
understood bash syntax, and also don't want to learn it :-P


Regards,

Michael. 




reply via email to

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