unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Petton <nicolas@petton.fr>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Using gv in map and seq?
Date: Thu, 18 Jun 2015 21:59:59 +0200	[thread overview]
Message-ID: <87egl86b40.fsf@petton.fr> (raw)
In-Reply-To: <jwvtwu6ckou.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]

Stefan Monnier <monnier@IRO.UMontreal.CA> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

  reply	other threads:[~2015-06-18 19:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 10:47 Using gv in map and seq? Nicolas Petton
2015-06-15 12:41 ` Stefan Monnier
2015-06-15 13:48   ` Nicolas Petton
2015-06-15 16:30     ` Stefan Monnier
2015-06-16  1:45       ` Stefan Monnier
2015-06-16  7:13         ` Nicolas Petton
2015-06-16 20:35         ` Nicolas Petton
2015-06-17  0:41           ` Stefan Monnier
2015-06-17 12:58             ` Stefan Monnier
2015-06-17 14:40               ` Nicolas Petton
2015-06-17 17:39                 ` Stefan Monnier
2015-06-18 19:59                   ` Nicolas Petton [this message]
2015-06-19  2:52                     ` Stefan Monnier
2015-06-16 21:28       ` Nicolas Petton
2015-06-18  8:31       ` [OT] Working with patches inlined in emails (was: Using gv in map and seq?) Nicolas Petton
2015-06-18  8:51         ` Eli Zaretskii
2015-06-18  9:27           ` [OT] Working with patches inlined in emails João Távora
2015-06-18  9:38           ` [OT] Working with patches inlined in emails (was: Using gv in map and seq?) Nicolas Petton
2015-06-18  9:45             ` Nicolas Petton
2015-06-18  8:58         ` [OT] Working with patches inlined in emails Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egl86b40.fsf@petton.fr \
    --to=nicolas@petton.fr \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).