Re: Road to Clojure Survey
- From: Rich Hickey <richhickey@xxxxxxxxx>
- Date: Sat, 21 Feb 2009 12:42:19 -0800 (PST)
On Feb 21, 2:50 pm, Pascal Costanza <p...@xxxxxxxxx> wrote:
Rich Hickey wrote:
On Feb 21, 1:16 pm, du...@xxxxxxxxx wrote:
On Feb 21, 6:43 am, Rich Hickey <richhic...@xxxxxxxxx> wrote:
On Feb 21, 6:57 am, Pascal Costanza <p...@xxxxxxxxx> wrote:Pascal is not likely to wave his own flag, but I don't think you
Helmut Eller wrote:This is FUD - please stop spreading it.
* Vend [2009-02-20 22:26+0100] writes:They can be used in Java, but you have to adapt your programming style.
FSet is a library, not a language.I'm confused by this whole discussion.
If I understand correctly, native immutable collections are just one
feature of Clojure, and it integrates well with other features
(polymorphic collection manipulation and concurrency control).
Aren't Clojure's collection classes just a library and the Clojure
compiler/language treats them just like any other Java class? Is there
a reason why those classes could not be used in normal Java programs?
Existing Java code will not just automagically work with them in the
general case.
realize whom you are talking to. Pascal was a Java programmer long
before he switched to Common Lisp, and his first writings on Common
Lisp (http://p-cos.net/lisp/guide.html) provide some of his
background. However, even if you look up his credentials and are not
impressed, at least realize what you yourself are doing; you are
posting in a Lisp newsgroup arguing with someone who has switched his
major emphasis from Java to Lisp, and so cries of FUD are going to
fall on deaf ears and numb them to other things you have to say.
I do know Pascal. We've met several times and had some great
discussions. I respect both him and his work. I know Pascal's opinions
are well regarded here, all the more reason for them to be accurate. I
too came to Lisp from C++/Java/C#, and greatly value the areas in
which it is superior. But his statement above is simply wrong. It is
not a matter of qualifications or opinion. If you have existing Java
code that takes a collection and does not mutate it you can pass a
Clojure collection and it will work without change or adaptation, i.e.
"automagically".
Two statements have been made, a qualified and an unqualified one. The
unqualified one was "Clojure's collections work seamlessly with Java
code" and the qualified one was "Clojure's collections work seamlessly
with Java code that doesn't mutate them." The first statement is wrong,
the second statement is correct.
Not true. The qualifier wasn't for the seamlessness, but for the
utility.
There is a large body of Java code for which this is
true, and people are leveraging that capability every day.
This may be true, but it doesn't mean that you can afford not to check
whether some arbitrary Java code is compatible with Clojure collections.
Absolutely not. A Clojure collection will work with existing Java code
in precisely the same way as an immutable Java collection, which is
already a legal and possible thing, you can create them, i.e. with
java.util.Collections.unmodifiableList/Map/Set etc. That is, existing
Java code, with whatever policy it has chosen for handling immutable
collections (which has nothing to do with Clojure), will work the same
way, unchanged, with Clojure collections. Other aspects of seamless
that come into play are the lack of copying, lack of adapter or
wrapper classes, direct support for the interfaces, testability via
instanceof, hashCode and equality semantics etc. I think it's seamless
for any reasonable definition of seamless.
Rich
.
- Follow-Ups:
- Re: Road to Clojure Survey
- From: Pascal Costanza
- Re: Road to Clojure Survey
- References:
- Road to Clojure Survey
- From: Kenneth Tilton
- Re: Road to Clojure Survey
- From: Mark H.
- Re: Road to Clojure Survey
- From: Scott Burson
- Re: Road to Clojure Survey
- From: André Thieme
- Re: Road to Clojure Survey
- From: Pascal Costanza
- Re: Road to Clojure Survey
- From: Rich Hickey
- Re: Road to Clojure Survey
- From: Pascal Costanza
- Re: Road to Clojure Survey
- From: Vend
- Re: Road to Clojure Survey
- From: Helmut Eller
- Re: Road to Clojure Survey
- From: Pascal Costanza
- Re: Road to Clojure Survey
- From: Rich Hickey
- Re: Road to Clojure Survey
- From: duane
- Re: Road to Clojure Survey
- From: Rich Hickey
- Re: Road to Clojure Survey
- From: Pascal Costanza
- Road to Clojure Survey
- Prev by Date: Re: Road to Clojure Survey
- Next by Date: Re: Road to Clojure Survey
- Previous by thread: Re: Road to Clojure Survey
- Next by thread: Re: Road to Clojure Survey
- Index(es):
Relevant Pages
|