Re: Why does Clojure at times use Java classes as their base type?

2014-02-04 Thread Brian Craft
On Sunday, February 2, 2014 3:07:27 PM UTC-8, Aaron France wrote: What's the benefit of hiding/abstracting the underlying platform away? The obvious answer to this is it limits exposure to the complexity of the underlying platform, and provides a stable platform. That's usually why people

Why does Clojure at times use Java classes as their base type?

2014-02-03 Thread Adrian Mowat
In a broader sense, it's because Clojure was designed to embrace the underlying runtime. As well as eliminating problems with leaky abstractions (as others have pointed out), it also encourages post to other runtimes like the CLR and JavaScript (clojurescript) Does anyone have a link to a

Why does Clojure at times use Java classes as their base type?

2014-02-02 Thread Mark Gandolfo
I tried asking this on twitter and wasn't getting my question across in 140 characters so I decided to post here. I'm curious as to why Clojure as a language hasn't abstracted/hidden all of Java's classes and created their own in the Clojure. namespace. For example Big Ints are of type and

Re: Why does Clojure at times use Java classes as their base type?

2014-02-02 Thread Aaron France
Hi, What's the benefit of hiding/abstracting the underlying platform away? There are reams of documentation about the Java classes and simply renaming them to say they are Clojure classes would seem to reduce the discoverability of those docs. JMTC Aaron On Sun, Feb 02, 2014 at 02:50:01PM

Re: Why does Clojure at times use Java classes as their base type?

2014-02-02 Thread Mikera
It would be a bad idea to wrap up everything in custom types: a) It would add a performance overhead. Better to use the Java types directly - they are very well optimised on the JVM b) It would make it much harder to use Java libraries and APIs. Java APIs expect the correct Java type, and

Re: Why does Clojure at times use Java classes as their base type?

2014-02-02 Thread Janne Lemmetti
There's a nice explanation on why Clojure has BigInt in Clojure Programminghttp://www.clojurebook.com/ (page 428). Like Mikera wrote, there were two reasons: one was that Java's BigInteger's hashCode is not consistent with Long's hashCode. Secondly Clojure BigInts have been optimized for