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

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

bug#44330: 26.3; doc string of `cl-some'


From: Drew Adams
Subject: bug#44330: 26.3; doc string of `cl-some'
Date: Sun, 1 Nov 2020 09:45:50 -0800 (PST)

> > "Return true if PREDICATE is true of any element of SEQ or SEQs.
> > If so, return the true (non-nil) value returned by PREDICATE."
> >                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > The second sentence is meaningless/underspecified.  If the function
> > stops as soon as it finds the first element for which PREDICATE is
> > true then the doc should say that it returns the value returned by
> > PREDICATE _for that element_.
> >
> > Without specifying, in some way, for which element the application of
> > PREDICATE returns non-nil, "the value returned by PREDICATE" has no
> > meaning.
> 
> I've now clarified the doc string here in Emacs 28.
> 
> However, the function is not guaranteed to stop at the first non-nil
> predicate value, so that's not specified.

According to the definition of Common Lisp, it is
ABSOLUTELY guaranteed to do just that.

https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node143.html

  `some' returns as soon as any invocation of predicate
  returns a non-nil value; some returns that value.
  If the end of a sequence is reached, some returns nil.
  Thus, considered as a predicate, it is true if some
  invocation of predicate is true.

And read more on that page - more about this guarantee,
and more about it applying to ALL of the functions some,
every, notany, and notevery. 

Is this a bug with the implementation of `cl-some'?
Or is it a doc bug?

Does Emacs `cl-some' pretend to respect the CL
definition of `some'?  If not, the doc should say
that explicitly, and it should spell out just how
it deviates from support of the standard.

(So far, this bug has, in effect, been declared
"won't fix".





reply via email to

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