[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Quick pcase question
From: |
Eric Abrahamsen |
Subject: |
Re: Quick pcase question |
Date: |
Wed, 02 Mar 2016 19:56:42 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> It's not so much the simplicity, I guess, as the intuitiveness --
>> "(and x" looks like a test to me, not an assignment.
>
> That's a valid point, I think.
>
> Maybe it would be better to avoid reusing names of frequently used
> functions. We could e.g. use "all" or "every" instead of "and", "any"
> or "some" instead of "or", and "bind" instead of "let", to avoid
> misleading associations in our brains.
I like the idea of variable assignment being a syntax thing -- it should
be obvious from the position of the symbol within the pcase test that
it's an assignment. Not that I'm really expecting the pcase syntax to
change because of my complaint!
But the fact is that pcase is (very complex and very useful) syntax
sugar. I just wrote a pcase clause that looks like:
`((,(and f-string (pred stringp)) . ,(and class (pred symbolp))) . ,(and regexp
(pred stringp)))
And that's kind of awful. The whole point of pcase should be concision,
but that looks pretty terrible.
Anyway, I'm just trying to get used to all the new toys...
E
- Quick pcase question, Eric Abrahamsen, 2016/03/02
- Re: Quick pcase question, Michael Heerdegen, 2016/03/02
- Re: Quick pcase question, Eric Abrahamsen, 2016/03/02
- Re: Quick pcase question, Michael Heerdegen, 2016/03/02
- Re: Quick pcase question,
Eric Abrahamsen <=
- Re: Quick pcase question, Michael Heerdegen, 2016/03/02
- Re: Quick pcase question, Phillip Lord, 2016/03/02
- Re: Quick pcase question, Eric Abrahamsen, 2016/03/02
- Re: Quick pcase question, Stefan Monnier, 2016/03/02
- Re: Quick pcase question, Phillip Lord, 2016/03/02
- Re: Quick pcase question, Eric Abrahamsen, 2016/03/02
- Re: Quick pcase question, Phillip Lord, 2016/03/03
Re: Quick pcase question, Phillip Lord, 2016/03/02