On Tue, Jan 13, 2009 at 3:03 AM, GS <gsincl...@gmail.com> wrote:
>
> Hi,
>
> I searched the archives and saw that this has been raised once before,
> although it wasn't really a suggestion, didn't raise any real
> discussion and didn't reach any conclusion.
>
> I just think it's worth proposing that a function set that includes
> every? and not-every? but does not include any?

That one is called "some". The name doesn't end with "?" because it
doesn't return true or false. It returns the first value that is
logically true.

> or none?

Hmm ... I'm not sure if an equivalent for that exists.

> feels like
> it's missing something.  These are useful functions and, I humbly
> suggest, cause needless surprise in the average user when (s)he
> discovers they don't exist.
>
> Of course, they are easy to implement oneself, or to find in a
> library, but they are also easy to include in the core.
>
> Also worth considering is exactly?  As in:
>  (defn exactly? [n pred coll] ...)
>    -> returns true iff exactly n elements of the collection satisfy
> the predicate
>
> The case is not as clear for that (I wouldn't have thought about it
> had I not seen it in a library), but it's worth considering.
>
> I realise that 'some can be used instead of 'any?, but:
>  * as mentioned before, the average user would expect that any? exists
>  * any? reads better in code when only a true/false value is required

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to