[Top][All Lists]

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

Re: New jrpc.el JSONRPC library

From: João Távora
Subject: Re: New jrpc.el JSONRPC library
Date: Mon, 21 May 2018 14:43:13 +0100

Hi Aaron,

Nice, i didn't know about that. Does it have an equivalent to 
&allow-other-keys and &rest? 


On Mon, May 21, 2018, 14:31 Aaron Ecay <address@hidden> wrote:
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]