From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.devel Subject: Re: Using gv in map and seq? Date: Thu, 18 Jun 2015 21:59:59 +0200 Message-ID: <87egl86b40.fsf@petton.fr> References: <87egldxn7p.fsf@petton.fr> <878ublkrqe.fsf@petton.fr> <871thbbdd0.fsf@petton.fr> <87twu6z9cc.fsf@petton.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1434657634 14841 80.91.229.3 (18 Jun 2015 20:00:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jun 2015 20:00:34 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 18 22:00:22 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z5fyw-0003RT-Kh for ged-emacs-devel@m.gmane.org; Thu, 18 Jun 2015 22:00:14 +0200 Original-Received: from localhost ([::1]:54729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5fyv-00087U-VU for ged-emacs-devel@m.gmane.org; Thu, 18 Jun 2015 16:00:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5fyo-00082q-Bn for emacs-devel@gnu.org; Thu, 18 Jun 2015 16:00:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5fyl-0003a1-3Y for emacs-devel@gnu.org; Thu, 18 Jun 2015 16:00:06 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5fyk-0003Ys-Tw for emacs-devel@gnu.org; Thu, 18 Jun 2015 16:00:03 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 3C5D7205D5 for ; Thu, 18 Jun 2015 16:00:02 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 18 Jun 2015 16:00:02 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=nQwXVJoUgTculplBbn02Jehu10w=; b=fkU4V TYkO4bjWYsg5jcJi01LQ0Ha2SMuCve83tBkh+bvOLYbdZoHorD58V1g+noxctq9h Rz1a8orsk8FpBkh0u0cTW8OVP7Nc4DADKgZntVkOznCcl7tBIDb/pLFdIqBs7K8G hA0l8eLyVOZfATZX05gVCHrbVoRtHaXhEWStxs= X-Sasl-enc: WbJGRBuTKRTIbtFYUKLIOJ45cAmjPckR6vw+VeKtzdwp 1434657601 Original-Received: from blueberry (unknown [80.216.74.58]) by mail.messagingengine.com (Postfix) with ESMTPA id 0A35268015D; Thu, 18 Jun 2015 16:00:00 -0400 (EDT) In-Reply-To: User-Agent: Notmuch/0.19 (http://notmuchmail.org) Emacs/25.0.50.3 (x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187292 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Stefan Monnier 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 ,mgett= er))) > :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 =2D-=20 Nicolas Petton http://nicolas-petton.fr --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJVgyM/AAoJECM1h6R8IHkQ9kAH/0ihT9ItieXZJOZSZtu47BMV mLGYBKk9mIFeBGlm2LbjemvM72Fiz3BhK3OOMcU+rxpb17wwdTGQAMAywf4luKEb CjIdgLf/e8nB+3BGdBi8uq7338F5P6p/JPqYhVIfNrsdLScIlqTSp77qj77ywQye AfDOXaKpfCZ7hZKVqQ/zU2qrNIFdlgJUVePL0ScvWejE5oKLtn6GLshlCSQz83P8 L7yXl+f+2HPrwzN9M/3pNT7q4WEoq7bR+vYMxDuhhFVlCo6lWtJA4nOoPvyTutrJ f3tk2DAmimsxXgeCXwJPpc02Ttz8MBVh+VmO7HRP953iDBdUbEf5qXO0AGgv9GM= =j+Fa -----END PGP SIGNATURE----- --=-=-=--