|
From: | João Távora |
Subject: | Re: New jrpc.el JSONRPC library |
Date: | Mon, 21 May 2018 14:43:13 +0100 |
Hi João,
One small remark:
2018ko maiatzak 20an, João Távora-ek idatzi zuen:
[...]
>> - Please use hashtables or alists instead of plists. There are many
>> more functions to operate on hashtables and alists,
>
> Maybe. Hmm, I really really don't know about this. Have you tried
> cl-destructuring-bind with plists? It really is the SH&T for JSON.
You can use pcase-let* and the ‘map’ pcase pattern (from the built-in
map.el) as a substitute when working with alists and hash tables. IOW,
the following two code snippets are equivalent:
(pcase-let* (((map foo bar) '((foo . 1) (bar . 2))))
(+ foo bar))
(cl-destructuring-bind (&key foo bar) '(:foo 1 :bar 2)
(+ foo bar))
--
Aaron Ecay
[Prev in Thread] | Current Thread | [Next in Thread] |