[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question on pcase
From: |
Eli Zaretskii |
Subject: |
Re: Question on pcase |
Date: |
Fri, 23 Oct 2015 09:30:02 +0300 |
> From: Michael Heerdegen <address@hidden>
> Date: Thu, 22 Oct 2015 23:19:18 +0200
>
> > 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
Maybe we should have some higher-level facility to expand a pcase into
a human-readable form. Would something like this be possible and
useful?
- Question on pcase, Oleh Krehel, 2015/10/22
- Re: Question on pcase, Michael Heerdegen, 2015/10/22
- Re: Question on pcase,
Eli Zaretskii <=
- Re: Question on pcase, Oleh Krehel, 2015/10/23
- Re: Question on pcase, Michael Heerdegen, 2015/10/23
- Re: Question on pcase, Oleh Krehel, 2015/10/23
- Re: Question on pcase, Michael Heerdegen, 2015/10/23
- Re: Question on pcase, Oleh Krehel, 2015/10/23
- Re: Question on pcase, Michael Heerdegen, 2015/10/23
- Re: Question on pcase, Johan Bockgård, 2015/10/27
- Re: Question on pcase, Michael Heerdegen, 2015/10/29
- Re: Question on pcase, Michael Heerdegen, 2015/10/23
- Re: Question on pcase, Michael Heerdegen, 2015/10/23