From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sho Takemori Newsgroups: gmane.emacs.bugs Subject: bug#23105: 25.0.92; map-put does not change its argument MAP Date: Sat, 26 Mar 2016 00:20:49 +0900 Message-ID: References: <8760waoddm.fsf@petton.fr> <871t6yoaho.fsf@petton.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11419b189ab787052ee11b00 X-Trace: ger.gmane.org 1458919293 20020 80.91.229.3 (25 Mar 2016 15:21:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Mar 2016 15:21:33 +0000 (UTC) Cc: 23105@debbugs.gnu.org To: Nicolas Petton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 25 16:21:24 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ajTY0-0000SX-F2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Mar 2016 16:21:12 +0100 Original-Received: from localhost ([::1]:56631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajTXz-0004QY-9N for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Mar 2016 11:21:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajTXu-0004QM-Dy for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 11:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajTXq-0006ab-Ak for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 11:21:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajTXq-0006aX-7I for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 11:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ajTXq-0006fd-3v for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 11:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sho Takemori Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Mar 2016 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23105 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 23105-submit@debbugs.gnu.org id=B23105.145891925925604 (code B ref 23105); Fri, 25 Mar 2016 15:21:02 +0000 Original-Received: (at 23105) by debbugs.gnu.org; 25 Mar 2016 15:20:59 +0000 Original-Received: from localhost ([127.0.0.1]:37987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajTXm-0006eu-VY for submit@debbugs.gnu.org; Fri, 25 Mar 2016 11:20:59 -0400 Original-Received: from mail-lf0-f48.google.com ([209.85.215.48]:36682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajTXi-0006eS-SI for 23105@debbugs.gnu.org; Fri, 25 Mar 2016 11:20:55 -0400 Original-Received: by mail-lf0-f48.google.com with SMTP id d82so56827074lfe.3 for <23105@debbugs.gnu.org>; Fri, 25 Mar 2016 08:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=i4V2BcJSLNqHViJSKGQdbF/PdX9cQDovVUqWAMCEaTc=; b=XRPo8MBM0+crVIc4toTVgN+EfxCXBGB2IKKuqODTAkonNBlQbN/UXvfOmhtM01qZai 0xjjB5dhD/9hAp502eBpuBcmbDDWkWm1OVbh0+N5sBXNv3DfiiV+wq6kLwYY6QZWU59C 0vbFa/PgmWH0f9MBPpDAenh+TAus0GFJQzrT5d5D+Fg5I/OQl14yR1xpDBLgWD5WPdHB Hxb1i4VMqYZiX5fTTUU4VkcRuh/O4VEYBIrOoRMrtGPZ1Z0sirtuIVzs5RV/9u9L7Okp NH16Wg0iNg1XyzYSTFJKJUcLvA6X2psOBWXFe0dgElQHb1OMzwcqNXHhGWVVyguEDPqa SfUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=i4V2BcJSLNqHViJSKGQdbF/PdX9cQDovVUqWAMCEaTc=; b=X+Zy/TA/uDRsMLit8Q/+83jj7v0uPIYwgg6clunuXTztWbkB/7G5Q0Q9Axq6XyREPr TxLP7IhXlVdUvDnGAGeJEXvCaSmyDkI+vzjqQeKoxSKWliAHbXDkLN94jcQJQFRSq6XQ IQFIwdKtiVpY9We2QP8zJQyBdixbj5PGqRKcgEbtURrDWEjF1ZO4qLtAFIzlo9RCptGp We6DGFmBhoTpo0UCWGpbzwnP40dxuAcQI+Eh/TpsMaBI78YjFYJnufLk7qj1RQOaNiXd EkpyHqgOk4Uw35gQRQQ8uMe7WQcbierxG+6IAQZ+dz4ywegGdTG3q2O2PU+s2JTauijg AIIw== X-Gm-Message-State: AD7BkJJBHaDX1nI4DKxk+LkQCX+wt45VP7PbZ0gnXpeZNTTasnqvbMLS6jlAL7UumqyIViWYiVRKR6TUlSuF2w== X-Received: by 10.25.84.1 with SMTP id i1mr5823995lfb.2.1458919249195; Fri, 25 Mar 2016 08:20:49 -0700 (PDT) Original-Received: by 10.112.35.231 with HTTP; Fri, 25 Mar 2016 08:20:49 -0700 (PDT) In-Reply-To: <871t6yoaho.fsf@petton.fr> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115484 Archived-At: --001a11419b189ab787052ee11b00 Content-Type: text/plain; charset=UTF-8 OK. Thanks for the reply. 2016-03-26 0:14 GMT+09:00 Nicolas Petton : > Sho Takemori writes: > > > Thanks for the fix. But after the fix, if MAP is a list literal, then it > > raises an error. > > For example, this raises an error. > > (map-put '((a . 1)) 'a "value") > > > > This works. > > (map-put [0 1 2] 1 "value") > > > > It is an expected error? > > Yes, in the sense that the same error will be raised if you try to do it > with a setf on an alist: > > (setf (alist-get 'b '((a . 1))) 3) ;; => invalid-function (a . 1) > > (let ((alist '((a . 1)))) > (setf (alist-get 'b alist) 3)) ;; => works fine > > Note however that mutating literal lists is in general not a good idea, > as conses might be shared. > > Nico > --001a11419b189ab787052ee11b00 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
OK. Thanks for the reply.


2016-03-26 0:14 GMT+09:00 N= icolas Petton <nicolas@petton.fr>:
Sho Takemori <stakemorii@gmail.com> writes:

> Thanks for the fix. But after the fix, if MAP is a list literal, then = it
> raises an error.
> For example, this raises an error.
> (map-put '((a . 1)) 'a "value")
>
> This works.
> (map-put [0 1 2] 1 "value")
>
> It is an expected error?

Yes, in the sense that the same error will be raised if you try to d= o it
with a setf on an alist:

(setf (alist-get 'b '((a . 1))) 3) ;; =3D> invalid-function (a .= 1)

(let ((alist '((a . 1))))
=C2=A0 (setf (alist-get 'b alist) 3)) ;; =3D> works fine

Note however that mutating literal lists is in general not a good idea,
as conses might be shared.

Nico

--001a11419b189ab787052ee11b00--