From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Lisp files that load cl-lib in problematical ways Date: Wed, 25 Oct 2023 00:57:29 -0700 Message-ID: References: <87il8betof.fsf@dataswamp.org> <83fs3dgxv8.fsf@gnu.org> <835y38qvlg.fsf@gnu.org> <87bkcx6eci.fsf@dataswamp.org> <83ttqnm4ti.fsf@gnu.org> <831qdlpoye.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28901"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, emacs-devel@gnu.org To: rms@gnu.org, Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 25 09:58:26 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 1qvYmY-0007AE-2Y for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Oct 2023 09:58:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvYlj-0004oN-QC; Wed, 25 Oct 2023 03:57:35 -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 1qvYli-0004no-5s for emacs-devel@gnu.org; Wed, 25 Oct 2023 03:57:34 -0400 Original-Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvYlg-0001Wd-LR; Wed, 25 Oct 2023 03:57:33 -0400 Original-Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2c5039d4e88so82556991fa.3; Wed, 25 Oct 2023 00:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698220650; x=1698825450; darn=gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=zKnyxVsBVkpOTrG9Gei3HleeDHjPtegRaH2tX4yGxDI=; b=k7jy/9wrhaQyr68oPyvFkcm/lDJvA1Bby8M5SwABl/qtEFLxB98BKTk7I0LheDKPf2 GRxX35m2OnWlwYbU3dYk1Q27JYlKkdj33/SmpMdesLFNHgJ4v6jyXp3fAB/7iAMHQMQj XxIXPmRtfbjqdPfSZXcdYM8kgdVkR/pbWwCCrtOiPEIKvj/4MZhfZqUQ9brRKUbjA4pJ sDKMXxdweBU0++AXxduJLeUi092mp5CQtxuthERMm++V9QKs4bDdnaP2Y4C655acp5aS VJs382Ebwu2zZ+kO5Lj1y30QN088JPtvnoa9DK2eW/DU84UaZyGxD84pfBelfh+3xSRg ZFVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698220650; x=1698825450; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zKnyxVsBVkpOTrG9Gei3HleeDHjPtegRaH2tX4yGxDI=; b=k64el5Azay+SHop5JD8F8rt4rA63kcURi5K/8Ds4wZ/2GwkpN9E7Arz7B8WVgBhRFL eTxdp24csHxIRDutPZHJi+6/hyM/6mkfCvrHrSX91U8H9Iu3ohlSf+j6Htf4M1qkC2+i rTKSvj00/Qn+rlpobn6jxQjOhqC0FLoS43XEZf2cXqdhLhqG7Q3GuyxeGZP5UO1NuQAu Ly+RPh3hzF1qjOnZGNwF8zd5nyhs2zvYOf/3daoQiYu73cASlu0cPh9CPa7/0aEhJV3C IfeUDHQyJvVi3GESXMZgDMnDNyJ9hcNZFgEuSwCno9P+MYk+yCzHlWXPpyFp72uShsBC sEqA== X-Gm-Message-State: AOJu0Yy+FK2HAbBdaxJfTvw3y6uoo3IYEpO+Is4MBs7zIkq0rOPICHnC 0BvVGuyot6RnUcuY7EgFZFivmE2E7x+A08Glhqd1IQytCWE= X-Google-Smtp-Source: AGHT+IGOwRKneoq1aL4LsTd38KqqWeUUdiydcg/BO9R/kuqi1W/9cMEFdaHG/C/QoTc2fi7tkYhCcyI+5k3W+AVtDX0= X-Received: by 2002:a2e:9d02:0:b0:2c5:2133:a9fc with SMTP id t2-20020a2e9d02000000b002c52133a9fcmr9511802lji.40.1698220649502; Wed, 25 Oct 2023 00:57:29 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 25 Oct 2023 00:57:29 -0700 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=stefankangas@gmail.com; helo=mail-lj1-x22a.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:311829 Archived-At: Richard Stallman writes: > But if we let ourselves be a little more flexible, how about this > solution: install this > > (while (string-match "\\W" abbrev pos) > (or (memq (aref abbrev (match-beginning 0)) badchars) > (push (aref abbrev (match-beginning 0)) badchars)) > (setq pos (1+ pos))) > > instead of the current code: > > (while (string-match "\\W" abbrev pos) > (cl-pushnew (aref abbrev (match-beginning 0)) badchars) > (setq pos (1+ pos))) > > A CL fan might say the latter is simpler, but for me, who isn't sure > just how to use cl-pushnew, the former seems conceptually simpler. The `cl-pushnew' docstring explains: Add X to the list stored in PLACE unless X is already in the list. > The two ecxpressions have two different kinds of complexity. The only difference I see is that new version is harder to read, and more prone to bugs (as you have to write the same code twice). I'd suggest avoiding these types of changes.