Clojure's false and true are Boolean/FALSE and Boolean/TRUE, and for speed reasons (I think) anything that checks for truthiness uses java's ==, which will fail on any new Boolean object. Usually, this isn't a problem, but sometimes it is. You can see that this assumption is pervasive by looking at the implementations of 'true?' and 'false?', which use identical? and the check for != Boolean.FALSE in https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2569
On Sun, Oct 6, 2013 at 5:27 PM, Pablo Nussembaum <[email protected]> wrote: > Hey Devs, > I have fighting against an issue that can summarized in the following line: > > user=> (not (new java.lang.Boolean false)) > false > > Is that behavior correct? > > Because if I run: > user=> (type false) > java.lang.Boolean > > Can someone help me to understand it? > > Thanks, > -- > Bauna > > -- > -- > 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/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 [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/groups/opt_out.
