Thanks for the responses. I agree that "some" takes care of things quite nicely. The asymmetrical naming convention in this case was what caught my eye. Just wanted to make sure if it was a deliberate design decision or an oversight. Sounds like it was done by design.
On Jun 14, 9:29 am, Ambrose Bonnaire-Sergeant <abonnaireserge...@gmail.com> wrote: > Hi David, > > any? would be redundant and less general than some, if I am not mistaken. > Compare the docstrings for the hypothetical "any?". > > (some p coll) > Returns the *first logical true value* of (pred x) for any x in coll, > else *nil*. > > (any? p coll) > Returns *true* if (pred x) is logical true for any x in coll, > else *false*. > > Since *nil* and *false* are both falsy, "some" can be used as a predicate > that is truthy > when it finds truthy result, otherwise falsy. This is exactly the behavior > expected from > an any? function. > > "some" is a poster boy for Clojure's well thought out truthyness system, > this is a great example > of the types of general functions it allows. > > Perhaps a pointer to "some" should be added in the docstring of "not-any?". > Although > a quick look at the source makes it crystal clear. I wasn't aware of > "not-any?"s existence, > maybe noting it in "some"s docstring could be beneficial also. > > Thanks, > Ambrose > > > > > > > > On Tue, Jun 14, 2011 at 3:08 PM, de1976 <davidescobar1...@gmail.com> wrote: > > Hello everyone. In looking through the API documentation, I've noticed > > that there is a "not-any?" function available, but there is no > > corresponding inverse "any?" function that I can find. There are, > > however, "every?" and "not-every?" functions available. The closest I > > could find was "some", but wouldn't it make sense to have an "any?" > > function for more obvious consistency? Thanks. > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clojure@googlegroups.com > > Note that posts from new members are moderated - please be patient with > > your first post. > > To unsubscribe from this group, send email to > > clojure+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en