emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New jrpc.el JSONRPC library


From: Aaron Ecay
Subject: Re: New jrpc.el JSONRPC library
Date: Mon, 21 May 2018 14:30:59 +0100
User-agent: Notmuch/0.26 (https://notmuchmail.org) Emacs/27.0.50 (x86_64-pc-linux-gnu)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]