From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#34708: alist-get has unclear documentation Date: Mon, 04 Mar 2019 14:49:15 -0800 Message-ID: <878sxui7bo.fsf@ericabrahamsen.net> References: <87wolhr5k6.fsf@web.de> <87y35xdu4w.fsf@web.de> <87mumcdu7f.fsf@web.de> <875zsyhakx.fsf@ericabrahamsen.net> <87fts2h9we.fsf@web.de> <871s3mh85d.fsf@ericabrahamsen.net> <874l8iebyz.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="209235"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34708@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 04 23:50:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0wPS-000sLN-HF for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 23:50:10 +0100 Original-Received: from localhost ([127.0.0.1]:34279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0wPR-000643-HN for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 17:50:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0wPL-00063v-Ms for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 17:50:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0wPL-0000sr-21 for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 17:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46829) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0wPK-0000rt-FO for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 17:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h0wPK-0004gq-8S for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 17:50:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Mar 2019 22:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34708 X-GNU-PR-Package: emacs Original-Received: via spool by 34708-submit@debbugs.gnu.org id=B34708.155173976817984 (code B ref 34708); Mon, 04 Mar 2019 22:50:02 +0000 Original-Received: (at 34708) by debbugs.gnu.org; 4 Mar 2019 22:49:28 +0000 Original-Received: from localhost ([127.0.0.1]:60373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0wOl-0004g0-KX for submit@debbugs.gnu.org; Mon, 04 Mar 2019 17:49:27 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:37898 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0wOi-0004fl-Gb for 34708@debbugs.gnu.org; Mon, 04 Mar 2019 17:49:25 -0500 Original-Received: from localhost (unknown [207.109.85.82]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 8FB3CFA02D; Mon, 4 Mar 2019 22:49:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ericabrahamsen.net; s=mail; t=1551739758; bh=e9CcJv3XN96t819Q8ESMXOKyLMowcW9k1w7AY/o3yIQ=; h=From:To:Cc:Subject:References:Date:From; b=IKplO2MT0FklOmeDp/6GtRn8Cv9XWeDr1aGHJ8Sg9QBRPiVIBvs/gakS2mTINb20e MyX9QDexpV6n7MZOwaOT0zWDcdP0wk4cBUkj0v3NijChA5ZUHnBs707X91JtRIob3l VhpIkQWm28Pajp4ZPV2zN4vg+2dxsN0Z+zoHBN74= 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: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:156047 Archived-At: On 03/04/19 19:22 PM, Michael Heerdegen wrote: [...] > This makes a call like > > (setf (alist-get key alist default) default) > > ambiguous: the "goal" (which is making (alist-get key alist default) > eval to DEFAULT) can be reached in two ways: (1) by making KEY being > associated with DEFAULT in ALIST and (2) by removing any existing > association for KEY. > > You can choose which behavior you want via the REMOVE argument which > comes after the DEFAULT arg: specifying REMOVE non-nil gives you (2) - > remove it - else you get (1). Thanks for spelling all this out! I guess my confusion is the interaction of REMOVE with DEFAULT. Why does REMOVE only do anything if the value being set is equal to the DEFAULT? If they are not equal, REMOVE is ignored, and the value is set. How does that make sense?