On Nov 19, 1:12 pm, Raffael Cavallaro <[EMAIL PROTECTED]>
wrote:
> user> (def test-array (make-array (. Boolean TYPE) 100))
> #'user/test-array
> user> (aget test-array 0)
> false
> user> (= (aget test-array 0) false)
> true
> user> (if (aget test-array 0) 'true-value 'false-value)
> true-value
>
> Same issue with when, and when-not as well. IOW, (aget some-boolean-
> array some-index) is treated as returning true even if the actual
> return value of aget is false.
Fixed (svn 1112) - thanks for the report.
The problem is that the Java reflection APIs return new Boolean values
other than the canonic Boolean.TRUE and Boolean.FALSE when boxing
booleans, but for efficiency only canonic false is logical false in
Clojure. Apparently, Array.get also falls into this category, so I had
to fix up all Boolean returns from Array.get
Rich
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---