On Tue, Apr 10, 2012 at 8:46 AM, Vinzent <[email protected]> wrote:

> So I agree: you cannot make it work for each and every JVM language, so
>> the current simplistic behavior is just fine.
>>
> Yeah, but my question about 'if' and equality remains open.
>

Not really, your example is trying to assign some special meaning to a Java
class whose value happens to be "false".

Using ".equals" equivalence in something as primitive as an if statement
would not only be inefficient, but lead to some really strange
consequences, since equals is override-able.

(deftype Bob []
  Object
  (equals [this o] true))

(.equals a true)
true

(.equals a false)
true

(= (Bob.) false)
true

(= (Bob.) true)
true

;; What should this do?
(if (Bob.) :true :false)
:true

-- 
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

Reply via email to