A) JVM does not = Java, that's the biggest misunderstanding that pours from
     all your posts. Read carefully the text on the page you referenced.
     Clojure shares JVM facilities, types, gcc, .... and happens to allow you 
to call Java...

B) JVM data types are of two kinds, primitive ones (boolean, char, int, ...) and
     complex like classes, interfaces and arrays. The Boolean class is not a JVM
     data type, it's a Java creation. The JVM is not aware that this class is 
"special",
     it's like any other class.

C) Your reference about same values does not stand, you are comparing a Java
     value (a Boolean class instance) with a Clojure boolean value which is 
represented
     by a JVM primitive boolean type.

     By which universal law these two things should be considered equal ? 
     The decision is an implementation choice mainly to allow the unification 
of null, nil
     and false when testing return values. The less troubesome path was chosen.

     Handling of numeric wrapped types like ints as Integer object led to
     different decisions. Clojure centric decisions, not based on having 
transparent Java
     interop.

D) In this context, Clojure  interop with the JVM is what makes Java interop
     less painfull. It does not imply that Clojure has to stick with Java 
conventions
     and oddities like Boolean vs the primitive type handling that was patched 
in Java
     after the fact.

E) Clojure reuses some Java types when fitted and not the other way around,
     the String class is a good example.






> 
> >
> > But interop is not the main goal in the design of the language...
> >
> > It's a nice feature.
> >
> That's not true. Clojure is a hosted language. Easy interop with the host 
> platform is one of the main goals of the language. See 
> http://clojure.org/jvm_hosted.
> 
> They are not "the same"
> 
>  
> I've said "same value", not the "same object". If some number equals 1, 
> then this number is 1, right? Also, '(1 2 3) and [1 2 3] represents the 
> *same* value, although they are backed by the different objects. I believe 
> this simple model of values (along with state and identity) is one of the 
> key clojure advantages. It's strange for me that equal objects representing 
> the *same* value are treated in different ways by clojure. It's the same as 
> if (= (map identity [1 2 3]) (map identity (into-array [1 2 3]))) would 
> return false.
> 
> The Boolean class is not used by Clojure to represent boolean values. It 
> > happens
> > that the java false primitive matches the Clojure representation for false.
> > The fact that Java considers the false primitive value to be the same as
> > (Boolean. false) is irrelevant here.
> 
>  
> 
> >  The boolean JVM class IS NOT a Clojure type as per Clojure, it's a Java
> > class, nothing more.
> 
> 
> That's not true. The quote from http://clojure.org/jvm_hosted:
> "Clojure is designed to be a hosted language, sharing the JVM type system"
> 
>  Anytime you are using directly a class, you quit the Clojure world to
> > dive in Java
> 
>  
> Clojure string are Java strings. Clojure numbers are Java numbers. So when 
> I'm writing (println "boo!") or (inc 1), you'd call it "quit the Clojure 
> world to dive in Java"?
> 
> This transparency may make you thing that this behaviour is odd but
> > it's an illusion.
> 
> 
> It's not an illusion. This behaviour is odd, and the existence of this 
> topic are the best evidence of this fact. 
> 
> -- 
> 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
--
Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail!

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

Reply via email to