[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcase-dolist
From: |
Tassilo Horn |
Subject: |
Re: pcase-dolist |
Date: |
Thu, 09 Jul 2015 15:34:00 +0200 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) |
Thierry Volpiatto <address@hidden> writes:
>> As I've said, you can use cdr-matching with a don't-care-pattern,
>> e.g.,
>>
>> (pcase-let ((`(,a ,b . ,_) (file-attributes "~/.emacs")))
>> (list a b))
>>
>> which clearly states that you know that the list returned by
>> `file-attributes' has more than two elements but you are only interested
>> in the first two.
>
> Ah! Ok so the dont-care-pattern handle all the remaining elements.
No, the crucial part is the dot separating the front from the rest of
the list. With `(,a ,b . ,r) the list of the 8 remaining file
attributes would be bound to r. When you don't need those, you can omit
the binding with the don't care pattern.
Bye,
Tassilo
- pcase-dolist, Michael Heerdegen, 2015/07/08
- Re: pcase-dolist, Stefan Monnier, 2015/07/08
- Re: pcase-dolist, Michael Heerdegen, 2015/07/08
- Re: pcase-dolist, Tassilo Horn, 2015/07/08
- Re: pcase-dolist, Stefan Monnier, 2015/07/08
- Re: pcase-dolist, Tassilo Horn, 2015/07/09
- Re: pcase-dolist, Thierry Volpiatto, 2015/07/09
- Re: pcase-dolist, Tassilo Horn, 2015/07/09
- Re: pcase-dolist, Thierry Volpiatto, 2015/07/09
- Re: pcase-dolist,
Tassilo Horn <=
- Re: pcase-dolist, Thierry Volpiatto, 2015/07/09
- Re: pcase-dolist, Stefan Monnier, 2015/07/09
- Re: pcase-dolist, Michael Heerdegen, 2015/07/09
- Re: pcase-dolist, Stefan Monnier, 2015/07/10
- Re: pcase-dolist, Tassilo Horn, 2015/07/10
- Re: pcase-dolist, Stefan Monnier, 2015/07/10
- Re: pcase-dolist, Artur Malabarba, 2015/07/08
- Re: pcase-dolist, Michael Heerdegen, 2015/07/08