[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generic functions: Specializers like `or' or `memq'?

From: Michael Heerdegen
Subject: Re: Generic functions: Specializers like `or' or `memq'?
Date: Sat, 06 Nov 2021 23:32:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Stefan Monnier via Users list for the GNU Emacs text editor
<> writes:

> The main problem is one of ordering between different methods when
> several methods are applicable.
> [ `cl-generic.el` solves this problem by forcing the generalizer to
>   come with a priority (a number), which makes the ordering "trivial"
>   for `cl-generic.el` but it can be hard to choose the right priority
>   to use when defining a new specializer/generalizer.  ]

I don't see this.  How would an `or' or `memql' specializer be different
from implementing the method several times for each alternative using
the same body?  There would be a problem only if the domains of the
specializers would not be disjoint.  But that can already happen now.  I
don't see why we would make the situation worse, unless the programmer
does really strange things like listing the same (sub)specializer in
mutliple `or' specializers.  This could be warned about.

I guess I have missed something.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]