|
From: | Dmitry Gutov |
Subject: | Re: Instead of pcase |
Date: | Thu, 16 Nov 2023 20:49:06 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
On 16/11/2023 20:39, T.V Raman wrote:
when-let let-alist etc have worked well for me.
when-let is not destructuring. let-alias is very limited -- destructuring only for one type.
What I meant is there are similar constructs in functional languages like ML/Haskell which have also been available lately in Python/Ruby/Rust, that allow both matching and getting the data out in the same construct, accepting many or all data types available in the language.
pcase is an implementation of that idea. Perhaps it looks a bit cryptic, but I'm not sure what better syntax it would have in Lisp, while retaining the same capabilities.
What threw me with pcase is there are lots of special chars in that particular example whose meaning I dont know, and looking those up and understanding their use at the same time was what chased me away
Perhaps (info "(elisp) pcase Macro") will help?
[Prev in Thread] | Current Thread | [Next in Thread] |