emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 8aa0386: Add seq-find


From: Stefan Monnier
Subject: Re: [Emacs-diffs] master 8aa0386: Add seq-find
Date: Fri, 11 Sep 2015 09:45:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>     Add seq-find
>     This function is similar to `seq-some' but returns the found element.
>     In the cases where nil can be the found element, a sentinel optional
>     argument can be provided to avoid ambiguities.

This text was not needed here.  It's already present in the code (where
it belongs).

> +  "Return the first element for which (PRED element) is non-nil in SEQ.
> +If no element is found, return SENTINEL or nil.

  "return SENTINEL or nil" should be just "return SENTINEL".

Not only it's shorter, but it's also more precise (the current text
doesn't say when it returns SENTINEL and when it returns nil).

> +Note that `seq-find' has an ambiguity if the found element is nil
> +and if no SENTINEL is specified, as it cannot be known if an
> +element was found or not."

It's not just for nil but for the case where the found value is
identical to SENTINEL.


        Stefan



reply via email to

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