[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 15:37:04 +0100 |
User-agent: |
Notmuch/0.26 (https://notmuchmail.org) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
Hi João,
2018ko maiatzak 21an, João Távora-ek idatzi zuen:
>
> Hi Aaron,
>
> Nice, i didn't know about that. Does it have an equivalent to
> &allow-other-keys and &rest?
&allow-other-keys is always true for the pcase version. As I understand
what &rest does, it lets you bind certain keys, and then bind the map
minus those keys to another variable. Thereʼs nothing like that out of
the box, but it can easily be implemented:
(pcase-defmacro map-and-rest (rest-var &rest keys)
`(and (map ,@keys)
(app (map-filter (lambda (key _val) (not (memq key ',keys))))
,rest-var)))
(pcase-let* (((map-and-rest rest foo bar) '((foo . 1) (bar . 2) (baz . 3))))
(list foo bar rest))
;; -> (1 2 ((baz . 3)))
--
Aaron Ecay
- Re: New jrpc.el JSONRPC library, (continued)
- Re: New jrpc.el JSONRPC library (Was: [ELPA] New package: eglot), Philipp Stephani, 2018/05/19
- Re: New jrpc.el JSONRPC library (Was: [ELPA] New package: eglot), Eli Zaretskii, 2018/05/19
- Re: New jrpc.el JSONRPC library, João Távora, 2018/05/20
- Re: New jrpc.el JSONRPC library, Eli Zaretskii, 2018/05/20
- Re: New jrpc.el JSONRPC library, João Távora, 2018/05/20
- Re: New jrpc.el JSONRPC library, Aaron Ecay, 2018/05/21
- Re: New jrpc.el JSONRPC library, João Távora, 2018/05/21
- Re: New jrpc.el JSONRPC library,
Aaron Ecay <=
- Re: New jrpc.el JSONRPC library, João Távora, 2018/05/21
- Re: New jrpc.el JSONRPC library, Aaron Ecay, 2018/05/23
- Re: New jrpc.el JSONRPC library, Stefan Monnier, 2018/05/23
- Re: New jrpc.el JSONRPC library, João Távora, 2018/05/23
- Re: New jrpc.el JSONRPC library, Stefan Monnier, 2018/05/23
- Re: New jrpc.el JSONRPC library, Stefan Monnier, 2018/05/21
- Re: New jrpc.el JSONRPC library, Philipp Stephani, 2018/05/24
- Re: New jrpc.el JSONRPC library, João Távora, 2018/05/24
Re: [ELPA] New package: eglot, Stefan Monnier, 2018/05/12