From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Mon, 30 Oct 2023 10:13:10 -0700 Message-ID: <7fb04539-53a2-f325-af35-2c9719565509@gmail.com> References: <83ttqnm4ti.fsf@gnu.org> <831qdlpoye.fsf@gnu.org> <83sf5xhnym.fsf@gnu.org> <871qdhk49w.fsf@dataswamp.org> <25914.49745.111873.734458@orion.rgrjr.com> <8334xud0fl.fsf@gnu.org> <6f9dba21-1e90-2cd1-2775-a9bde3d0188f@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16273"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 30 18:14:24 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qxVqJ-00048t-3a for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Oct 2023 18:14:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxVpI-0002xr-IY; Mon, 30 Oct 2023 13:13:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxVpH-0002xU-5E for emacs-devel@gnu.org; Mon, 30 Oct 2023 13:13:19 -0400 Original-Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxVpC-0002sd-9l; Mon, 30 Oct 2023 13:13:18 -0400 Original-Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b6f4c118b7so4198656b3a.0; Mon, 30 Oct 2023 10:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698685992; x=1699290792; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=TrCnq49bm2eeCc0Qz4PbCH4ER+SnCqQLkhCruxumPPw=; b=OBoA9wkTYdrIkdFDkv3h7To4DD0hBPJTgpxdGejVSrMhM06748UgD8Xh2LfWhur6am Yogc/3QFBalhEha56S3CgAXjh4kyx3ndyusUH4CQBQ9UUwN9a338hZ/QkfbNaNnw43L6 YeZsSFfMl1ktDogWPjAeFM90+GGnTZKzCQLYDB6KFdkwiS9V+/JQEr2eYcXEEHR5hnft AZPJ+kOBqImx4p2Hu3atfIVcjxPnOIP/K350H1zpKGyVUk+KfFh6fO1J5dpG/w+misIl 3N4liCbhHXQSsbVih1sMPkajPPCv1Hvrka57LXkdqipUxU/N1R+l+ZOd9SXmkmRfaI/g 8AAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698685992; x=1699290792; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TrCnq49bm2eeCc0Qz4PbCH4ER+SnCqQLkhCruxumPPw=; b=PBqcyq5ddB6bTJU4tzhEXot0Zilk8tOTN6RZE0WSA3vUldjWXfMoHVM0R7hBAK3+ra 3dCtdUllzx4MO3/iDpYRLTLwN3O1HEiEdd7zftpvhB7iFzZ2STn38vJCFgRLrPG1ltDD FOIF6YtEVLaiNqd9Nw6bDy6G0KKPGa5ySeI/PFo4S34X27XR/WRdimJ6OzE41Rwbza81 3HUzVxuJTH4/vPgkO/g9oJqXGG1qM/Bvw7DGtj/abZN6YA/sa7SZWwdHV6OHwy4CQYja vIeTScIq0PSxy5WDigiZjS+WWlahSrRcCsnr57Tn21HLnMWjUL8nOzSatfb7q2qurEca s1pg== X-Gm-Message-State: AOJu0YzdJyNMj6DrVAejv9QVpqbKZGhrXc/tTIUf+W85DdN4UFMU8ONV fvLxhtrX0eBbsSp2N1/Dq7Z0/6RrbAc= X-Google-Smtp-Source: AGHT+IEbnHoT/CMayuspHJRGsoBGgqncjYy3qG2WzEBnuXgRhI5PA9XwrfbbzfzcJK9vGlRSk8rhXQ== X-Received: by 2002:a05:6300:8085:b0:180:d45e:727c with SMTP id ap5-20020a056300808500b00180d45e727cmr819930pzc.46.1698685991929; Mon, 30 Oct 2023 10:13:11 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id o29-20020a63921d000000b0059d34fb9ccasm4917385pgd.2.2023.10.30.10.13.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Oct 2023 10:13:11 -0700 (PDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=jporterbugs@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311998 Archived-At: On 10/29/2023 7:09 PM, Richard Stallman wrote: > > Of the conveniences, I think the ones I'd miss the most are 'cl-incf' > > and 'cl-decf', which I use in Eshell for recounting some handles. > > If this pattern extends to many files -- if getf, incf and decf are > particularly useful among CL constructs -- making them standard parts of Emacs Lisp would be better than inducing lots of files to load cl-lib. I don't think I'd fight tooth and nail to get incf/decf, but I'd certainly be happy to see them in standard Elisp. I'm not sure how much others want to see setf-like constructs in Elisp[1], but I like them quite a bit. They fit in neatly alongside the C/C++ parts of my brain. Specifically, I find this style: (cl-incf (cdr output-target)) - or - output_target.tail++; a lot nicer than this: (setcdr output-target (1+ (cdr output-target))) - or - output_target.tail = output_target.tail + 1; [1] I recall that some generalized values for setf were deprecated recently, but I think that was mainly for things where the setter had some non-obvious behavior.