[Top][All Lists]

[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/ (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?

Nicolas Petton

Attachment: signature.asc
Description: PGP signature

reply via email to

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