Re: Road to Clojure Survey
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Sat, 21 Feb 2009 22:53:07 +0100
Rich Hickey wrote:
On Feb 21, 2:50 pm, Pascal Costanza <p...@xxxxxxxxx> wrote:Rich Hickey wrote:On Feb 21, 1:16 pm, du...@xxxxxxxxx wrote:Two statements have been made, a qualified and an unqualified one. TheOn Feb 21, 6:43 am, Rich Hickey <richhic...@xxxxxxxxx> wrote:I do know Pascal. We've met several times and had some greatOn Feb 21, 6:57 am, Pascal Costanza <p...@xxxxxxxxx> wrote:Pascal is not likely to wave his own flag, but I don't think youHelmut 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.
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".
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.
I made the qualified statement. I guess I know better what the qualifier was for.
There is a large body of Java code for which this isThis may be true, but it doesn't mean that you can afford not to check
true, and people are leveraging that capability every day.
whether some arbitrary Java code is compatible with Clojure collections.
Absolutely not.
Do I speak Spanish, or what?!?
import clojure.lang.*;
import java.util.*;
public class Test {
public static void main(String[] args) {
Cons cons = new Cons(1, new Cons(2, new Cons(3, null)));
Collections.addAll(cons,4);
System.out.println(cons);
}
}
java -classpath clojure.jar Test
Exception in thread "main" java.lang.UnsupportedOperationException
at clojure.lang.ASeq.add(ASeq.java:109)
at java.util.Collections.addAll(Collections.java:3515)
at Test.main(Test.java:8)
Pascal
--
ELS'09: http://www.european-lisp-symposium.org/
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.
- Follow-Ups:
- Re: Road to Clojure Survey
- From: Rich Hickey
- 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
- Re: Road to Clojure Survey
- From: Rich Hickey
- 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
|