when you say the word "false" I'm assuming you're referring to "false?" the
function (not "false" the boolean value), otherwise I don't understand

so like: "What matters is that *false?* returns truthy values when called
with any members of []"
makes sense to me.

So all I was saying above is that it should throw when [] is empty just as
it does when [] is not empty, but it doesn't throw when empty because it's
never called (by "it" i mean "false" not "false?")

=> (type false)
java.lang.Boolean
=> (type false?)
clojure.core$false_QMARK_
=> (fn? false)
false
=> (fn? false?)
true

But really, if you were not talking about "false?" then I don't get it (??)


On Thu, May 23, 2013 at 4:48 PM, Michał Marczyk <michal.marc...@gmail.com>wrote:

> Whether (false 1) or (false true) is truthy is irrelevant. What
> matters is that false returns truthy values when called with any
> members of [], which is of course the case, as [] has no members. (For
> it not to be the case, there would have to exist an x in [] for which
> (false x) were not truthy -- clearly there is no such x.)
>
> This is the same story as with quantification restricted to the empty set:
>
>   \forall x \in \emptyset . \phi(x)
>
> is true regardless of what \phi is, and intimately related to how
> implication works in classical logic (since the above is shorthand for
> a formula involving implication):
>
>   x -> y
>
> is true when x is false, regardless of what value y takes. (It's also
> true when y is true, regardless of what value x takes; this, however,
> is not relevant here.)
>
> Cheers,
> M.
>
>
> On 23 May 2013 06:31, atkaaz <atk...@gmail.com> wrote:
> > Well, seems to me more like this:
> > if [] is empty then return true
> > otherwise check (pred everyx in coll)
> > however this allows for any pred especially(in this case) invalid preds:
> > `false` is not a function/pred
> > => (false 1)
> > ClassCastException java.lang.Boolean cannot be cast to clojure.lang.IFn
> > cgws.notcore/eval2542 (NO_SOURCE_FILE:1)
> > => (false true)
> > ClassCastException java.lang.Boolean cannot be cast to clojure.lang.IFn
> > cgws.notcore/eval2564 (NO_SOURCE_FILE:1)
> >
> > doesn't seem truthy to me
> >
> > Thanks.
> >
> >
> > On Thu, May 23, 2013 at 3:08 AM, Michał Marczyk <
> michal.marc...@gmail.com>
> > wrote:
> >>
> >> On 22 May 2013 18:34, atkaaz <atk...@gmail.com> wrote:
> >> > I think the exception is thrown because you basically called (every?
> >> > false
> >> > coll) however on my clojure version I cannot reproduce it  oh wait
> there
> >> > we
> >> > go, some bug here with empty collection (maybe someone can pick it
> up):
> >> > => (every? false [1 2 3])
> >> > ClassCastException java.lang.Boolean cannot be cast to
> clojure.lang.IFn
> >> > clojure.core/every? (core.clj:2423)
> >> > => (every? false [])
> >> > true
> >> >
> >> > => *clojure-version*
> >> > {:interim true, :major 1, :minor 6, :incremental 0, :qualifier
> "master"}
> >>
> >> (every? false []) should return true if and only if (false x) is
> >> truthy for every x in [], which is certainly the case.
> >>
> >> Cheers,
> >> Michał
> >>
> >>
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On Wed, May 22, 2013 at 7:17 PM, Peter Mancini <
> peter.manc...@gmail.com>
> >> > wrote:
> >> >>
> >> >> So I did some coding and came up with this but it is broken;
> >> >>
> >> >> (= java.lang.Boolean (type false))  ;;evaluates to true
> >> >>
> >> >> (defn all-true?
> >> >>   [coll]
> >> >>   (every? (cond (= java.lang.Boolean (type identity)) identity :else
> >> >> false) coll)) ;;compiles
> >> >>
> >> >> (all-true? '(true true true))  ;; throws
> java.lang.ClassCastException:
> >> >> java.lang.Boolean cannot be cast to clojure.lang.IFn
> >> >> (all-true? '(true true false))
> >> >> (all-true? '(true true 3))
> >> >>
> >> >> --
> >> >> --
> >> >> 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 unsubscribe from this group and stop receiving emails from it,
> send
> >> >> an
> >> >> email to clojure+unsubscr...@googlegroups.com.
> >> >> For more options, visit https://groups.google.com/groups/opt_out.
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > --
> >> > 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 unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to clojure+unsubscr...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/groups/opt_out.
> >> >
> >> >
> >>
> >> --
> >> --
> >> 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 unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to clojure+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/groups/opt_out.
> >>
> >>
> >
> > --
> > --
> > 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 unsubscribe from this group and stop receiving emails from it, send an
> > email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
> --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to