bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#34852: 26.1; seq-intersection ignores nil as element


From: Basil L. Contovounesios
Subject: bug#34852: 26.1; seq-intersection ignores nil as element
Date: Fri, 15 Mar 2019 15:55:58 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"Miguel V. S. Frasson" <mvsfrasson@gmail.com> writes:

> In any case, of another implementation for seq-intersection or not, I
> think that the solution from Stefan should be implemented anyway
> because
>
> * it makes seq-contains provide a useful return value when ELT=nil, so
> it is a good exception; If ELT=nil, seq-contains currently returns nil
> anyway;

Special-casing nil invalidates any benefits of returning the element
found, as it conflates nil and t and is inconsistent with other non-nil
values.  If seq-contains is to be made a proper predicate that continues
returning the element found, then the best proposal so far has been
Michael's[1], namely to return (list ELT).  The alternative is to simply
return a boolean, rather than the element found, but this is lossier
than Michael's suggestion.

[1]: https://debbugs.gnu.org/34852#68

-- 
Basil





reply via email to

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