[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using gv in map and seq?
From: |
Nicolas Petton |
Subject: |
Re: Using gv in map and seq? |
Date: |
Thu, 18 Jun 2015 21:59:59 +0200 |
User-agent: |
Notmuch/0.19 (http://notmuchmail.org) Emacs/25.0.50.3 (x86_64-unknown-linux-gnu) |
Stefan Monnier <address@hidden> writes:
>> 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.
You lost me :-)
Could you explain a bit more?
Nico
--
Nicolas Petton
http://nicolas-petton.fr
signature.asc
Description: PGP signature
- Re: Using gv in map and seq?, (continued)
- 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, 2015/06/17
- Re: Using gv in map and seq?,
Nicolas Petton <=
- 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