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: Thu, 24 Mar 2016 21:09:31 +0900 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3b44ea2892e052eca51a2 X-Trace: ger.gmane.org 1458821434 14910 80.91.229.3 (24 Mar 2016 12:10:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2016 12:10:34 +0000 (UTC) To: 23105@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 24 13:10:21 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 1aj45i-0002vi-Dh for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Mar 2016 13:10:18 +0100 Original-Received: from localhost ([::1]:49907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj45h-0003lX-2s for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Mar 2016 08:10:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj45Y-0003j1-Vs for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 08:10:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj45S-0004ke-OP for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 08:10:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj45S-0004kT-Ki for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 08:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aj45S-0000b6-Gg for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 08:10: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: Thu, 24 Mar 2016 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23105 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14588213832263 (code B ref -1); Thu, 24 Mar 2016 12:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Mar 2016 12:09:43 +0000 Original-Received: from localhost ([127.0.0.1]:35135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aj459-0000aQ-C5 for submit@debbugs.gnu.org; Thu, 24 Mar 2016 08:09:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aj458-0000aE-FX for submit@debbugs.gnu.org; Thu, 24 Mar 2016 08:09:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj451-0004cE-V7 for submit@debbugs.gnu.org; Thu, 24 Mar 2016 08:09:37 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj451-0004cA-RT for submit@debbugs.gnu.org; Thu, 24 Mar 2016 08:09:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj450-0003c9-Ek for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 08:09:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj44y-0004bj-Tj for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 08:09:34 -0400 Original-Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:34262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj44y-0004be-Gg for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 08:09:32 -0400 Original-Received: by mail-lb0-x233.google.com with SMTP id k12so28857435lbb.1 for ; Thu, 24 Mar 2016 05:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=0hDqOE5UuCALwBlDMCXT60pvPkpehN/qP+O+q9dui1I=; b=Nnees6ezrHS0rNUSUk8flpsEHLLbGgZ//n4Tq9jjl6tqFciXuYu598dUixfrauWh0Y cz/1I7h2rqBHNo8bGEwsc9Ljm36QA85tNM/RJL9z1PU4wZdrQC/S91UFRJuhW/3qFBYH bKsR2CWTjl9XdrWxzaA2VfYPpkiqksiWZg3Ib+jt1LcKZqLuhNk/7CLDRkWWMLmaKEgX qaIzopMg+cdLFgaDDhRKPqp+pHXXI+nrOfSiBKOW8bNJ39GTB7IAXl4VRwGgjVwHzy8w Yd3VmrGeNimQhOxlW9IaG4iOb9OBwzWK3Us8LPPpRUDIjr7Cmhm2xcE+15/UhrJtCtDL vwJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=0hDqOE5UuCALwBlDMCXT60pvPkpehN/qP+O+q9dui1I=; b=mj268FfAB9EubCU2M3oVpoywujwFsbSfVR/BYeMhBbYg4OKCh3Z80EF6osdU/dZiI0 gHAc2sMpKAXgsAXWEpkPNlLQ5CDTxshfJ2JkHc5gj9zOqXEVjc7zRT1+EYLXsqcqWaoD WwrCkh80iaxz5MnzliSulzEKLLNIpnJN6vyKGLt6v7blinwHFPeqwJt5B2u4Gu8dZB9Y 2TsgDg0mkB1nHhJ2T8nx9bO/vK7eu0+y9wwcNWMoru4eJkBMwOM5FQYPWeRrKOW7FH83 C9lgoEWe18FuPwLs8jVaf/Z+mqODZpBksX2ivhz2T8Bju+Xyk/xlgeRxtGZyxoucq1vl fBUA== X-Gm-Message-State: AD7BkJJKChyFFyOWDHGlHxhyYw3mebsG6ywt+Az3NmSdQ2TbPO5UVeGH+1Giawg1hFWSgXkLA9FEJy17xMs9Kw== X-Received: by 10.112.13.8 with SMTP id d8mr3263347lbc.110.1458821371429; Thu, 24 Mar 2016 05:09:31 -0700 (PDT) Original-Received: by 10.112.35.231 with HTTP; Thu, 24 Mar 2016 05:09:31 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:115437 Archived-At: --001a11c3b44ea2892e052eca51a2 Content-Type: text/plain; charset=UTF-8 I'm not sure if this is a bug, but the function map-put does not change its argument MAP if the map is an alist and the key is not found. For example, the following code returns "value" as expected: (require 'map) (let ((m (make-hash-table))) (map-put m 'key "value") (map-elt m 'key)) If I replace m by an alist, then the following code returns nil. I expected it returned "value" as above. (let ((m nil)) (map-put m 'key "value") (map-elt m 'key)) By expanding map-put, I found that it returns a new list if "m" is a list and the key is not in "m". Best regards, Sho Takemori In GNU Emacs 25.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.7) of 2016-03-24 built on K430-Ubuntu Repository revision: c0165ea4d6ecf81db6728782c7322c311ee0a783 Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Ubuntu 15.10 Configured using: 'configure --with-sound=no --with-file-notification=yes' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LC_MONETARY: ja_JP.UTF-8 value of $LC_NUMERIC: ja_JP.UTF-8 value of $LC_TIME: ja_JP.UTF-8 value of $LANG: ja_JP.UTF-8 value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set map "value" Mark set nil [2 times] scroll-up-command: End of buffer Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils map seq byte-opt gv bytecomp byte-compile cconv cl-extra help-mode easymenu cl-loaddefs pcase cl-lib time-date mule-util japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 95859 6137) (symbols 48 20522 0) (miscs 40 327 121) (strings 32 16995 4550) (string-bytes 1 505060) (vectors 16 13958) (vector-slots 8 527873 8024) (floats 8 182 21) (intervals 56 220 12) (buffers 976 11) (heap 1024 50485 944)) --001a11c3b44ea2892e052eca51a2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I'm not sure if this is a bug, but the function m= ap-put does not change its
argument MAP if the map is an alist an= d the key is not found.

For example, the following= code returns "value" as expected:

(requ= ire 'map)
(let ((m (make-hash-table)))
=C2=A0 (map-= put m 'key "value")
=C2=A0 (map-elt m 'key))

If I replace m by an alist, then the following code = returns nil.
I expected it returned "value" as above.

(let ((m nil))
=C2=A0 (map-put m 'key= "value")
=C2=A0 (map-elt m 'key))

By expanding map-put, I found that it returns a new list if "= m" is a list and
the key is not in "m".
=
Best regards,
Sho Takemori

In GNU Emacs 25.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.7)
=C2=A0of 2016-03-24 built on K430-Ubuntu
Repository revis= ion: c0165ea4d6ecf81db6728782c7322c311ee0a783
Windowing system di= stributor 'The X.Org Foundation', version 11.0.11702000
S= ystem Description: Ubuntu= 15.10

Configured using:
=C2=A0'conf= igure --with-sound=3Dno --with-file-notification=3Dyes'

<= /div>
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMA= GICK GPM DBUS GCONF GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML= 2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11<= /div>

Important settings:
=C2=A0 value of $LC_= MONETARY: ja_JP.UTF-8
=C2=A0 value of $LC_NUMERIC: ja_JP.UTF-8
=C2=A0 value of $LC_TIME: ja_JP.UTF-8
=C2=A0 value of $LA= NG: ja_JP.UTF-8
=C2=A0 value of $XMODIFIERS: @im=3Dfcitx
=C2=A0 locale-coding-system: utf-8-unix

Major mo= de: Lisp Interaction

Minor modes in effect:
<= div>=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
= =C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2= =A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
<= div>=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: = t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mo= de: t
=C2=A0 transient-mark-mode: t

Rece= nt messages:
For information about GNU Emacs and the GNU system, = type C-h C-a.
Mark set
map
"value"<= /div>
Mark set
nil [2 times]
scroll-up-command: End= of buffer

Load-path shadows:
None found= .

Features:
(shadow sort mail-extr emacs= bug message dired format-spec rfc822 mml
mml-sec password-cache e= pg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse = rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 = ietf-drums mm-util help-fns mail-prsvr mail-utils map
seq byte-op= t gv bytecomp byte-compile cconv cl-extra help-mode easymenu
cl-l= oaddefs pcase cl-lib time-date mule-util japan-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
=
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page=
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font= -lock
syntax facemenu font-core frame cl-generic cham georgian ut= f-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean ja= panese eucjp-ms
cp51932 hebrew greek romanian slovak czech europe= an ethiopic indian
cyrillic chinese charscript case-table epa-hoo= k jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvic= e loaddefs button faces
cus-face macroexp files text-properties o= verlay sha1 md5 base64 format
env code-pages mule custom widget h= ashtable-print-readable backquote
dbusbind inotify dynamic-settin= g system-font-setting font-render-setting
move-toolbar gtk x-tool= kit x multi-tty make-network-process emacs)

Memory= information:
((conses 16 95859 6137)
=C2=A0(symbols 48= 20522 0)
=C2=A0(miscs 40 327 121)
=C2=A0(strings 32 16= 995 4550)
=C2=A0(string-bytes 1 505060)
=C2=A0(vectors = 16 13958)
=C2=A0(vector-slots 8 527873 8024)
=C2=A0(flo= ats 8 182 21)
=C2=A0(intervals 56 220 12)
=C2=A0(buffer= s 976 11)
=C2=A0(heap 1024 50485 944))

--001a11c3b44ea2892e052eca51a2--