As a side effect of conjoin using every? and disjoin using some,
disjoin returns nil and disjoin returns false in cases when the
Is that a good idea? Does renaming disjoin to disjoin? make any sense?
b.ghose at gmail.com
Both return functions, so it doesn't make sense for disjoin/any to end in ?
> You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
> To post to this group, send email to cloju...@googlegroups.com.
> To unsubscribe from this group, send email to clojure-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/clojure-dev?hl=en.
I'm concerned about the proposed names being confused with conj and disj (especially by new users.) In particular, the doc strings say that they're short for conj[oin] and disj[oin]. 'any' and 'all' might be better. Although, confusion with 'any?' could also be an issue. That's another reason to go with contrib for the first release.
Clojure already has comp and juxt, which follow this pattern of taking var-args of functions. That part seems OK to me.
2011/1/25 Steve Miner <steve...@gmail.com>:
I named my versions any-pred & every-pred, fwiw.
I'll take them in core as every-pred and any-pred, but you'll have to
do the variadic unrolling as per comp and juxt. Extra credit for a
macro that eliminates the tedium of such unrolling and works for comp,
juxt et al.
Thanks for the work on this, Fogus! The patch needs a small fix, and maybe some discussion about the name "some" vs. "any". I would like to get this in today, if anybody has time to respond to questions at http://dev.clojure.org/jira/browse/CLJ-729.
(defn every-pred [& preds]My $.02
(fn [& args] (if (every? #(every? % args) preds)) true false)))
(defn any-pred [& preds]
(fn [& args] (if (some #(some % args) preds)) true false))