From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.diffs,gmane.emacs.devel Subject: Re: master b0eb668 2/2: * lisp/emacs-lisp/map.el (map--dispatch): Move before use. Date: Sat, 06 Jun 2015 00:38:50 +0200 Message-ID: <87y4jxok5h.fsf@petton.fr> References: <20150605203242.15469.7882@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5346065269131262852==" X-Trace: ger.gmane.org 1433543966 8276 80.91.229.3 (5 Jun 2015 22:39:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jun 2015 22:39:26 +0000 (UTC) Cc: emacs-diffs@gnu.org, emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-diffs-bounces+gnu-emacs-diffs=m.gmane.org@gnu.org Sat Jun 06 00:39:14 2015 Return-path: Envelope-to: gnu-emacs-diffs@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 1Z10GT-0005mY-4T for gnu-emacs-diffs@m.gmane.org; Sat, 06 Jun 2015 00:39:01 +0200 Original-Received: from localhost ([::1]:49921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z10GS-0007qk-99 for gnu-emacs-diffs@m.gmane.org; Fri, 05 Jun 2015 18:39:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z10GO-0007qV-Hc for emacs-diffs@gnu.org; Fri, 05 Jun 2015 18:38:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z10GL-0000QB-4w for emacs-diffs@gnu.org; Fri, 05 Jun 2015 18:38:56 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:33835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z10GL-0000Pi-1x for emacs-diffs@gnu.org; Fri, 05 Jun 2015 18:38:53 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 6581C20BF6 for ; Fri, 5 Jun 2015 18:38:52 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Fri, 05 Jun 2015 18:38:52 -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=zuLcfYcDWKaeq0GQ9zWQSOSHm/c=; b=dDfAk zAdg4H2UzWXg0QQ07788ObHnLOoZB0HKqZnm8S+WtM/8RMbweNTcWndr+SrpZrvL car93OQxNd/n7E/qM/VcOFmtrSg/EmeHZtF5/jVAKJFMlLDA34h7qdYLEbA44keF 7PjcSCEDXGFqiYflzN1dcVGNJ0tyIwJjwP417w= X-Sasl-enc: QXGDFG/WwuIIRRCr5eZzNTop7wLUidm0QVlKyWNmfgVD 1433543931 Original-Received: from blueberry (unknown [80.216.74.58]) by mail.messagingengine.com (Postfix) with ESMTPA id 9F58BC00018; Fri, 5 Jun 2015 18:38:51 -0400 (EDT) In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.28 X-BeenThere: emacs-diffs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Mailing list for Emacs changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-diffs-bounces+gnu-emacs-diffs=m.gmane.org@gnu.org Original-Sender: emacs-diffs-bounces+gnu-emacs-diffs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.diffs:130658 gmane.emacs.devel:187057 Archived-At: --===============5346065269131262852== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Glenn Morris writes: > branch: master > commit b0eb66823f12c85d04e36ddd0e58e20c0a0694db > Author: Glenn Morris > Commit: Glenn Morris > > * lisp/emacs-lisp/map.el (map--dispatch): Move before use. There is still an issue with the byte compiler and `map-put' (it could also happen with `map-delete'): in case of a list, a symbol has to be used since `map-put' internally uses `setq' to mutate the map: (map-put mylist :b 2) ;; This is fine (map-put '((:a . 1)) :b 2) ;; This is not ok While it works fine with other maps (where setq is not used): (map-put [a b c] 0 d) ;; This is fine, but the byte compiler will compl= ain The macro is using `map--dispatch' to evaluate the correct form based on the type of the map, and while *I* know that `setq' will only be used if `map' is a list, the byte compiler doesn't seem to know that, and throws an error. Wrapping the call to `setq' in an `if' form to check if `map' is a symbol could maybe fix the issue, but I was wondering if there was a better solution. Cheers, 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 iQEcBAEBAgAGBQJVciT6AAoJECM1h6R8IHkQEtkIAKCE3P1oXcDDJjIo3lctCHuJ rwdCZTZX6BwSP9snSByDhFDCPMWPcJg8RESNJSOBYNipfzskOPbyvf1CBm70f4CO vJrR1zPcaJfPnKyacZmERsBX8Nf10cWy9tMXwaRPjrEV6IhmfaasAuVS4EGOmlzp akACwRCyClI9udQir8Bc1XH/n3jBeFNVEFrKDjIeP1pBCe3RBXH0oyU4Rv5o2LWa LbG4LtulA2QY3gDzabCHj7xC9gPldNci3GmsT/8xmLKKWQUqhMaYvt3pM47/Kf1D PTeHzc40ZsjcTL2ZWpnXUubDzzvKw7Mfazh5n+MTLZSl+knZTmvEydZi9PDG4tw= =eT7M -----END PGP SIGNATURE----- --=-=-=-- --===============5346065269131262852== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline