On 7/15/16, 12:27 PM, "Atamert Ölçgen" <[email protected] on behalf of [email protected]> wrote: > > (defn any? > > [x] true) > I can't think of a single use case where this function would be useful
I don’t speak for Clojure/core but… This will be used in some of the spec in clojure.java.jdbc 0.6.2 because there are functions whose result type depends on the signatures of up to two transforming functions that are optionally passed in, as well as an option that controls how the result set is built. Without a full dependent type system, “any?” is about as much as you can assert about those results. I can also see it being useful when programmatically constructing predicates to use over collections. People often use identity but that doesn’t always help, such as constructing a filter where you want all values to be retained. Previously, you’d have to use (constantly true) but that could accidentally be called with any number of arguments – any? is specifically a one-argument predicate so it’s much more clear to use that. Sean Corfield -- (904) 302-SEAN -- (970) FOR-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
