From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: map-put! and (setf (map-elt ...) ..) on lists Date: Tue, 18 Dec 2018 08:56:04 -0500 Message-ID: References: <87y38p4ely.fsf@tromey.com> <8b3d6cc4-43ac-48cc-be4c-917f601faa43@default> <87imzstm6v.fsf@petton.fr> <89a74aae-cc0d-4fea-aeef-1e4afdc518e5@default> <87bm5jm9eu.fsf@petton.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1545147874 1738 195.159.176.226 (18 Dec 2018 15:44:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Dec 2018 15:44:34 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Tom Tromey , Drew Adams , emacs-devel@gnu.org To: Nicolas Petton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 18 16:44:29 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZHXm-0000GB-4p for ged-emacs-devel@m.gmane.org; Tue, 18 Dec 2018 16:44:26 +0100 Original-Received: from localhost ([::1]:54622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZHZq-0005kT-JQ for ged-emacs-devel@m.gmane.org; Tue, 18 Dec 2018 10:46:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZHPe-0006vZ-9I for emacs-devel@gnu.org; Tue, 18 Dec 2018 10:36:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZHPa-0004Bq-SE for emacs-devel@gnu.org; Tue, 18 Dec 2018 10:36:02 -0500 Original-Received: from chicot.dit.umontreal.ca ([132.204.13.19]:50092) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZHPa-00049H-CJ for emacs-devel@gnu.org; Tue, 18 Dec 2018 10:35:58 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wBIDu5BY030612; Tue, 18 Dec 2018 08:56:05 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id D9B786AAB6; Tue, 18 Dec 2018 08:56:04 -0500 (EST) In-Reply-To: <87bm5jm9eu.fsf@petton.fr> (Nicolas Petton's message of "Tue, 18 Dec 2018 11:11:37 +0100") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6441=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6441> : inlines <6986> : streams <1807488> : uri <2766521> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 132.204.13.19 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231905 Archived-At: >> map-put!: >> >> Associate KEY with VALUE in MAP and return VALUE. >> If KEY is already present in MAP, replace the associated value >> with VALUE. Not sure which version you were looking at, but what I see is: "Associate KEY with VALUE in MAP. If KEY is already present in MAP, replace the associated value with VALUE. This operates by modifying MAP in place. If it cannot do that, it signals the `map-not-inplace' error. If you want to insert an element without modifying MAP, use `map-insert'." > As I said, I like Stefan's approach, but if everybody else dislike it, > and if you think it's not idiomatic Elisp, then let's change the name. > > Stefan, would it be ok with you? As I said, I like Scheme's ! convention, but I really don't care very much about the name: I think normal code should never call this function directly and should use `(setf (map-elt ...) ..)` instead anyway! So, even a longwinded name would be perfectly fine. Stefan