From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Thu, 16 Nov 2023 21:58:51 +0000 Message-ID: References: <8734xetjkk.fsf@yahoo.com> <87cywhsrcf.fsf@yahoo.com> <87cywgx1z0.fsf@web.de> <83wmuowwp3.fsf@gnu.org> <8334xcwank.fsf@gnu.org> <320999cc-6c83-2315-0044-cc0403400af3@gutov.dev> <9ab5d2bd-a648-cae0-a4a7-ae86be10af0f@gutov.dev> <87r0kuqxbf.fsf@gmail.com> <54e115a2-fc36-3056-a030-0dbf32416ddb@gutov.dev> <43f290b0-4119-597b-c89a-0fb4c7db1665@gutov.dev> <87bkbtn79k.fsf@web.de> <87wmuhpxxv.fsf@gmail.com> <87v8a1lodp.fsf@web.de> <83msvdps4k.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bc8ed4060a4c15f0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9713"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 16 22:56:29 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 1r3kLa-0002HS-Jj for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Nov 2023 22:56:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3kLG-0007zh-S2; Thu, 16 Nov 2023 16:56:06 -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 1r3kLE-0007zN-7r for emacs-devel@gnu.org; Thu, 16 Nov 2023 16:56:04 -0500 Original-Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3kLC-0004DB-B9; Thu, 16 Nov 2023 16:56:04 -0500 Original-Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7ad501cb1f9so46035939f.0; Thu, 16 Nov 2023 13:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700171759; x=1700776559; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DvsCpMe2XME+gSDsE3Xz3pNOVc7kT2RKMC8EAbWagXQ=; b=I3CWDQSHCBFXgXvskhKIkCyhV0a3G6bz/UcqN8T1zxXyyEbHCyEEJhTZdPBmrEDHRd SIj9jziS8M9aRTHb+NoUAETS3JSZCB/iVV3A4z9KSsuGnJvhkYHKvzz23T+6waDJ4OWX QiGuTuoSroZUCgnS1pbxp+mVpC+ncabvyz4XGgc3vQ+sE3Wo6FSkytHCaHGDEoI5LLz0 llelTWKUh8AkTh1vafZgKN3yKSPlehfJuyZd6A8qIcHMfnzH5bs40CkO/fPt7iaqc/Lw PzGgv4w+eArPxbASDXsk7GDCdBCRVI/FMU99b5I5mlsJsQQuPCt4pBV8P9YcDbnjnLqq WCTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700171759; x=1700776559; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DvsCpMe2XME+gSDsE3Xz3pNOVc7kT2RKMC8EAbWagXQ=; b=Hxsr+2cSEIzW1bI1yHCkqwF0VRLDctBvAbF8yMHM6YSGjBvLYTAYl7SdXFFMqwWuSb LdtCc7zsiYuZtDEyhTVDcFxTZ6KDZlISdfWMLdUFvTcTby/SW3GvnMsYXNZFmMGd9vZj nMinPpCfjvLMIirdxzG8dpz0HozofeoN0TIctt+fEv+mMwg8WXZ9NzhXx7BAR/+ijtPN Cs9I9/E/XaMW0B3eE/YvV2jP6oSIgyWE4S7STQMTx597LjlVMsrCeoywjhyrhSdBtoLi CKEzjP0oPtDICdAhtyHXJEQYeHhYXlJeDwLS/0rnRd4ORtgfYu/6Qu15ElWt6ulhd/J9 kP5Q== X-Gm-Message-State: AOJu0YyNlgjKDEOP2KJD8gyjzhNg2w7wJAV9rgj61fe/FeZOTePuvqen AekjCBopp5paXVt7Xu2lQAlfvOg+F/ZUupEILLZpEgxRUnQ= X-Google-Smtp-Source: AGHT+IFhPK5KY9TS6SbQZUCyGXezZpUa7cMMCOiojiR16RfZytDHMOdI1P0lLWXK65+DiDrjVG+4gdCiUDnvfj6VJKg= X-Received: by 2002:a6b:c506:0:b0:794:eaef:f43e with SMTP id v6-20020a6bc506000000b00794eaeff43emr18893633iof.1.1700171758733; Thu, 16 Nov 2023 13:55:58 -0800 (PST) In-Reply-To: <83msvdps4k.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::d2b; envelope-from=joaotavora@gmail.com; helo=mail-io1-xd2b.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, HTML_MESSAGE=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:312840 Archived-At: --000000000000bc8ed4060a4c15f0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Nov 16, 2023 at 4:42=E2=80=AFPM Eli Zaretskii wrote: > ?? There's a whole section in the ELisp manual called "Sequence > Functions", which documents the seq-* functions. Yes, but from a custom sequence implementors perspective, the "best" documentation is still that bit in the header, which describes "you must implement these to get a working custom sequence". So while the Elisp manual addresses custom sequences (very briefly -- it just tells the user to look up generic functions) it spends most time describing the generic functions one by one, and while that's important, it's just not enough. It doesn't talk about the guarantees that the framework offers with respect to when they are called, or if they are called at all. For example, while I didn't read the whole thing, I don't think it is stated that custom sequences based on Lisp lists need many more gf implementations than others, else they simply won't work (because of list-specific shortcutting optimizations only found when reading the seq.el code). Nor is it stated that, for any representation, :around methods are probably a bad idea. Nor is it stated that if you just implement the bare minimum (which is described in seq.el's header) you will likely get very poor performance. Such a manual is where one would find sentences like "to make a working custom sequence that is accepted by any seq-* call, the user must add implementations to the following N generics. To get good performance you must also add implementations to these other M generics". (Dmitry's proposed seq-contains-pred would be in this set). Jo=C3=A3o --000000000000bc8ed4060a4c15f0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Nov 16, 2023 at 4:42=E2=80=AFPM = Eli Zaretskii <eliz@gnu.org> wrote:
> ?? There's a whole section in the ELisp manual called "Sequen= ce
> Functions", which documents the seq-* functions.

Yes, but from a custom sequence implementors perspective,=C2=A0
the "best" documentation is still that bit in the hea= der,=C2=A0
which describes "you must implement = these to get a working=C2=A0
custom sequence".<= br>

So while the Elisp manual = addresses custom sequences
(very briefly -- it just = tells the user to look up generic
functions) it spen= ds most time describing the generic=C2=A0
functions = one by one, and while that's important, it's=C2=A0
just not enough.

= It doesn't talk about the guarantees that the framework=C2=A0
offers with respect to when they are called, or if they=C2=A0=
are called at all. For example, while I didn't = read the=C2=A0
whole thing, I don't think it is = stated that custom sequences
based on Lisp lists nee= d many more gf implementations=C2=A0
than others, el= se they simply won't work (because of=C2=A0
list= -specific shortcutting optimizations only found=C2=A0
when reading the seq.el code).=C2=A0 Nor is it stated that, for=C2=A0
any representation,=C2=A0 :around methods are probably = a bad
idea. Nor is it stated that if you just implem= ent the bare
minimum (which is described in seq.el&#= 39;s header) you will=C2=A0
likely get very poor per= formance.

Such a manual = is where one would find sentences like=C2=A0
"t= o make a working custom sequence that is accepted by
any seq-* call, the user must add implementations to=C2=A0
the following N generics.=C2=A0 To get good performance=C2=A0
you must also add implementations to these other M=C2= =A0
generics".=C2=A0 (Dmitry's proposed seq= -contains-pred would=C2=A0
be in this set).

Jo=C3=A3o

--000000000000bc8ed4060a4c15f0--