From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: alist-get in Emacs 24? Date: Thu, 8 Oct 2015 08:53:55 -0700 (PDT) Message-ID: References: <871tddvl08.fsf@mbork.pl> <877fn5hgg8.fsf@web.de> <87k2qyij75.fsf@mbork.pl> <87egh5g48f.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1444319846 22932 80.91.229.3 (8 Oct 2015 15:57:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Oct 2015 15:57:26 +0000 (UTC) To: Michael Heerdegen , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 08 17:57:14 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from eggs.gnu.org ([208.118.235.92]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZkDZA-0005EN-8V for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 17:57:12 +0200 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDXx-0005cI-Cc for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 11:57:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDXx-0005bd-90 for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 11:55:57 -0400 Original-Received: from localhost ([::1]:35709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDXx-0002Ew-6G for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 11:55:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDX8-00029N-93 for help-gnu-emacs@gnu.org; Thu, 08 Oct 2015 11:55:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkDW4-0002Fk-97 for help-gnu-emacs@gnu.org; Thu, 08 Oct 2015 11:55:06 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:42158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkDW3-00027C-En for help-gnu-emacs@gnu.org; Thu, 08 Oct 2015 11:53:59 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t98Frvta008173 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 8 Oct 2015 15:53:57 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t98FrueS025817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 8 Oct 2015 15:53:56 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t98FruZs017681; Thu, 8 Oct 2015 15:53:56 GMT In-Reply-To: <87egh5g48f.fsf@web.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 Xref: news.gmane.org gmane.emacs.help:107555 Archived-At: > Second, yes, you could modify the list structure, but this can't be > done if the alist is empty, because the empty (a)list is not a cons. > At least in this case, your setter would still have to receive a symbol. I don't see it that way. How is this different from defining `delete' or any of the other structure potentially-modifying functions? None of those functions require you to pass a symbol argument. The only function I can think of offhand that does that is `add-to-list'. Its more common (and generally more useful) cousins, `push' and `pushnew' don't do that. Yes, with such (destructive) functions, if you have a variable pointing to the list (empty or not), you do need to re-set it to the result returned by the function. But that's all, AFAIK. As I said (examples): (setq THE-VAR (my-set-alist-value key alist value)) (setq foo (delete 42 foo))