[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using gv in map and seq?
From: |
Stefan Monnier |
Subject: |
Re: Using gv in map and seq? |
Date: |
Wed, 17 Jun 2015 13:39:16 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> Just out of curiosity, where is this restriction set?
The code I sent was broken (in the list case where we need to set the
MAP, the code does (setq map ..) where `map' is an internal variable,
IOW it sets the wrong thing) so the restriction didn't actually appear.
It should look a bit more like:
(put 'map--raw-place 'gv-expander #'funcall)
[...]
(declare
(gv-expander
(lambda (do)
(gv-letplace (mgetter msetter) map
(macroexp-let2* nil
;; Eval them once and for all in the right order.
((key key) (default default))
`(map--dispatch ,mgetter
:list ,(gv-get `(alist-get ,key (map--raw-place ,mgetter
,msetter)
,default)
do)
:hash-table ,(funcall do `(gethash ,key ,mgetter ,default)
(lambda (v) `(puthash ,key ,v ,mgetter)))
:array ,(funcall do `(aref ,mgetter ,key)
(lambda (v) `(aset ,mgetter ,key ,v)))))))))
And this "raw-place" should probably be added to gv.el.
Stefan
- Using gv in map and seq?, Nicolas Petton, 2015/06/15
- Re: Using gv in map and seq?, Stefan Monnier, 2015/06/15
- Re: Using gv in map and seq?, Nicolas Petton, 2015/06/15
- Re: Using gv in map and seq?, Stefan Monnier, 2015/06/15
- Re: Using gv in map and seq?, Stefan Monnier, 2015/06/15
- Re: Using gv in map and seq?, Nicolas Petton, 2015/06/16
- Re: Using gv in map and seq?, Nicolas Petton, 2015/06/16
- Re: Using gv in map and seq?, Stefan Monnier, 2015/06/16
- Re: Using gv in map and seq?, Stefan Monnier, 2015/06/17
- Re: Using gv in map and seq?, Nicolas Petton, 2015/06/17
- Re: Using gv in map and seq?,
Stefan Monnier <=
- Re: Using gv in map and seq?, Nicolas Petton, 2015/06/18
- Re: Using gv in map and seq?, Stefan Monnier, 2015/06/18
- Re: Using gv in map and seq?, Nicolas Petton, 2015/06/16
- [OT] Working with patches inlined in emails (was: Using gv in map and seq?), Nicolas Petton, 2015/06/18
- Re: [OT] Working with patches inlined in emails (was: Using gv in map and seq?), Eli Zaretskii, 2015/06/18
- Re: [OT] Working with patches inlined in emails, João Távora, 2015/06/18
- Re: [OT] Working with patches inlined in emails (was: Using gv in map and seq?), Nicolas Petton, 2015/06/18
- Re: [OT] Working with patches inlined in emails (was: Using gv in map and seq?), Nicolas Petton, 2015/06/18
- Re: [OT] Working with patches inlined in emails, Andreas Schwab, 2015/06/18