[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What's missing in ELisp that makes people want to use cl-lib?
|
From: |
Michael Heerdegen |
|
Subject: |
Re: What's missing in ELisp that makes people want to use cl-lib? |
|
Date: |
Thu, 16 Nov 2023 14:43:19 +0100 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) |
João Távora <joaotavora@gmail.com> writes:
> This is all interesting, until one ponders what happens if an existing
> seq.el user somewhere has:
>
> (cl-defmethod seq-contains-p ((seq my-voodoo-seq)
> (elt (eql :secret-voodoo)) &optional _tesfn)
> (invoke-voodoo-priests seq))
>
> making use of seq.el's support for abstract polymorphic sequences.
>
> With seq.el 2.24 a seq-difference operation would consider this user's
> method, with seq.el 2.24.dmitry (i.e. your fast seq-difference-3) it
> simply won't. This user's code is clearly broken.
It is debatable whether the result of such a seq difference is even well
defined with the information you provided to Elisp:
- the difference of two voodoo sequences should be a voodoo sequence
so it will contain :secret-voodoo
- since both voodoo sequences contain :secret-voodoo, the result
should _not_ contain it.
AFAIR it was not among the design ideas of seq.el to provide an
interface for tweaking seq.el implementations for special cases.
That you can define new implementations doesn't mean you have to, like
the fact that you can advice any functions doesn't mean it's a good idea
to do that.
The functions are generics mainly for the purpose to allow the support
new sequence types. When you want to add a new type, it's expected
that you provide a consistent set of implementations for all generics.
In some cases, as you mentioned, some arguments will probably never be
specialized on (sorry if this is not correct English...). This could be
avoided but one of the main goals was to keep the code simple and
developers didn't expect people to shoot themselves in the foot on
purpose.
But yes, a bit more documentation about how this lib is supposed to be
used would definitely not harm. I can't even tell whether it was a good
idea to use generic functions but the author and Stefan M. did so I
think that this had been thought about.
Michael.
- Re: What's missing in ELisp that makes people want to use cl-lib?, (continued)
- Re: What's missing in ELisp that makes people want to use cl-lib?, Dmitry Gutov, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Dmitry Gutov, 2023/11/20
- Re: What's missing in ELisp that makes people want to use cl-lib?, Michael Heerdegen, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Michael Heerdegen, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?,
Michael Heerdegen <=
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Michael Heerdegen, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Eli Zaretskii, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Michael Heerdegen, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/16
- Re: What's missing in ELisp that makes people want to use cl-lib?, Eli Zaretskii, 2023/11/17
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/17
- Re: What's missing in ELisp that makes people want to use cl-lib?, João Távora, 2023/11/17
- Re: What's missing in ELisp that makes people want to use cl-lib?, Eli Zaretskii, 2023/11/17