From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Thu, 16 Nov 2023 15:36:32 +0100 Message-ID: <875y21kbnz.fsf@gmail.com> References: <12da6bcb-1818-7fbe-12af-8d4607724332@gutov.dev> <87il6bt4z0.fsf@yahoo.com> <8734xetjkk.fsf@yahoo.com> <87cywhsrcf.fsf@yahoo.com> <87cywgx1z0.fsf@web.de> <83wmuowwp3.fsf@gnu.org> <87fs172i62.fsf@gmail.com> <87y1ey1zn9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10782"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Michael Heerdegen , emacs-devel@gnu.org, Dmitry Gutov To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 16 15:37:06 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 1r3dUP-0002dW-56 for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Nov 2023 15:37:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3dU0-0006q1-Tw; Thu, 16 Nov 2023 09:36:40 -0500 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 1r3dTy-0006ps-VC for emacs-devel@gnu.org; Thu, 16 Nov 2023 09:36:38 -0500 Original-Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3dTx-0006wy-BG; Thu, 16 Nov 2023 09:36:38 -0500 Original-Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-41e1921da84so5182931cf.1; Thu, 16 Nov 2023 06:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700145396; x=1700750196; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=//wSZpriI6S8GpbErhap/5jocv5hpuq4r8QNXOosw8g=; b=SOzONSxoIUoii9zGvc294jUpciB1aXlCNsiRKySPu9fvbS6n0JUejBC9dc8KwXhFNa 0DAyqJaf0lVJ7ps112cYU3Wc6HXbnxAOu17Blx/UEafNCIXvjIfFP8tpSyUxIJvupwpw a29e3qhiLX+tJUvndL874Mv5kzlpT08pKNIWsDcOmfi+fIV7pwXZ59NbBpcTii6tOqgV Il9w2aaHXaItLXJg199/364gJLNOPewuyOnVUvgkS3Inw54mF+8tS8H52vCU20bm9edd nsmlDRVzM/w3tspOc+P2HNHE0RNsP/V3v39zPeG0scNYqqx95XMXBafSfq1LjOdGiLl0 4fNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700145396; x=1700750196; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=//wSZpriI6S8GpbErhap/5jocv5hpuq4r8QNXOosw8g=; b=oVD8E/NmgXnujG88toxHP2uCCAXU9LVaoPYcqRVy7Gvk4637/vDzxISI+zukoBgdNv K98axX0fhLab7C1b/DZeuaezciBmKdoYA4x0eRRrvyGaaRUqDFhH2K911b+aVPbQQ8/C J4F0pZ55wRGbb5jfnVs6EFJlnl/ipPRr+kAGE03e6qOPP3a/XOIkJWCVx7OIxACAmHP7 vWtBjY8wLStCSqNToqUtxVId9c1s9wsYJllYLaUK1+j6IVk8HX3SKmU8AAORsQe7VwqG vwXQFH/W3DRvsnSdZI1Rf4aPiyI0/PWFNXyfnYNM6PaCPNdXLHyHrA9yauvR43hYECli Beog== X-Gm-Message-State: AOJu0YyeEDjP7s+9ekptf15BIf4KuH+TSNrAUjeEWbfR27miqRAYcXqr qAvPGTbJ8OGdpAS+YfpcT5A= X-Google-Smtp-Source: AGHT+IEppEigKiubqxYh5juf4BdLzpsDHDr8+WSDFuOh3YGKXcwjElw6EnH0/d66RaPgrrMUK9KCrg== X-Received: by 2002:a05:622a:190d:b0:41e:4968:12e4 with SMTP id w13-20020a05622a190d00b0041e496812e4mr10473782qtc.39.1700145395602; Thu, 16 Nov 2023 06:36:35 -0800 (PST) Original-Received: from ars3 ([2601:193:8201:6b70:ce48:802c:b8ef:d777]) by smtp.gmail.com with ESMTPSA id c24-20020ac85198000000b0041e383d527esm4318974qtn.66.2023.11.16.06.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 06:36:34 -0800 (PST) In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Thu, 16 Nov 2023 00:28:11 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=arstoffel@gmail.com; helo=mail-qt1-x82a.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, T_SCC_BODY_TEXT_LINE=-0.01 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:312797 Archived-At: On Thu, 16 Nov 2023 at 00:28, Jo=C3=A3o T=C3=A1vora wrote: > I don't think you just skip the seq-do generic like that :-) Of course you don't. This _is not_ a patch submission :-). What I'm pointing out is that the seq-doseq macro is probably the most consequential bit regarding performance. If you use a mapc and closures where you could use a simple dolist, performance will obviously suffer. There exist extensible macros in Emacs (such as pcase), so adding some kind dynamic dispatch for seq-doseq should be possible. Barring that, one would have to define list-specific methods for 8 generic functions that use seq-doseq, which is also not unfeasible. > That breaks any sequence type based on lists. This is exactly the > problem I was raising with too-many-generic interfaces, btw. Good point. IMO you just can't have both lists and "types based on lists" to work together properly; if we defined a method for seq-difference on lists, the issue would be the same (I guess that's the caveat you raised regarding Dmitri's patch). I don't see much appeal in user-defined seq types (as opposed to dealing uniformly with lists, vectors and strings, which is mildly useful). In any case, the user always has the options to wrap a struct or class around their custom list types. So "sequence types based on lists" could just be disallowed (I suppose this was part of those long discussions, which I admit I didn't follow closely.) > Try Dmitry's patch instead, the one containing seq-difference-3. That approach is fine, but it only addresses one function at a time. (If we go that way, I suggest starting by the most useful ones: seq-filter, seq-some and seq-reduce.) >> I for one like the simple aesthetics of seq. > > Are you familiar with the cl-lib.el "aesthetics"? Yes. > The simple versions argumentless versions are no uglier than seq's, As far as names are concerned, cl-remove-if-not is uglier than seq-filter. > cl-some vs seq-some > cl-every vs set-every-p > cl-set-difference vs seq-intersection cl-set-difference is an operation on lists, not sets... > What specific thing do you like in seq.el that you don't > find in the sequence functions of cl-lib.el? Like other people already said, it's more about what you _don't_ find in seq. The seq API is much more straightforward than cl-lib's.