[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The poor state of documentation of pcase like things.
From: |
Phillip Lord |
Subject: |
Re: The poor state of documentation of pcase like things. |
Date: |
Sat, 19 Dec 2015 19:29:22 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Michael Heerdegen <address@hidden> writes:
> Michael Heerdegen <address@hidden> writes:
>
>> As far as I understand how Stefan used to work, most of the semantics of
>> most of the pcase derivatives, like `pcase-let', are not yet 100% fixed,
>> we are not yet sure how useful we are, or if they may later be better be
>> replaced by other forms that are more general, etc.
>
> BTW3, we were not yet all agreed how the semantics of `pcase-dolist'
> should be when the pattern doesn't match (currently, AFAIK, it loops
> nonetheless). Similarly for pcase-let and pcase-lambda. For some of
> these forms, we do not yet know how useful they are.
pcase-lambda seems useful to me, seems to only take a single pattern,
like so:
(funcall
(pcase-lambda (`(,x ,y))
y)
'(1 2))
To me, it would be more useful if it supported multiple patterns.
(funcall
(pcase-lambda
((1)
(message "Is a one"))
(`(,_)
(message "is a list")))
1)
The non-matching situation would then be in the hands of the user. Or it
would be possible to make a "pcase-lambda-exhaustive" macro (probably
with a better name".
I'd also rename "pcase.el" to "p.el" but hey, that's a different story.
> Just some examples of open questions that shows that some stuff is still
> a bit of work in progress.
One that's already getting quite a bit of use.
Phil
- Re: The poor state of documentation of pcase like things., (continued)
- Re: The poor state of documentation of pcase like things., John Wiegley, 2015/12/22
- Re: The poor state of documentation of pcase like things., Phillip Lord, 2015/12/19
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
- Re: The poor state of documentation of pcase like things., Phillip Lord, 2015/12/19
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/20
RE: The poor state of documentation of pcase like things., Drew Adams, 2015/12/16
Re: The poor state of documentation of pcase like things., Phillip Lord, 2015/12/17
Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
Re: The poor state of documentation of pcase like things., Eli Zaretskii, 2015/12/19
Re: The poor state of documentation of pcase like things., Alan Mackenzie, 2015/12/19