Re: Bug: (list? (cons 4 '(1 2 3))) returns false!

2009-06-28 Thread Meikel Brandmeyer
Hi, Am 28.06.2009 um 07:45 schrieb Handkea fumosa: It's list? that isn't. No. list? is not broken. Every list is a seq, but not every seq is a list. Consider: (cons 0 (iterate inc 1)) This is no list! It's a sequence. Why should list? return true? In Clojure there is no such thing as a

Re: ClassCastException - maybe a bug

2009-06-28 Thread Meikel Brandmeyer
Hi, Am 27.06.2009 um 22:30 schrieb Handkea fumosa: I'd agree that a ClassCastException is not inappropriate if you try to put heterogeneous objects into a sorted-set. But contains? should probably just return true or false, never throw. Michael's set doesn't contain 5; asking whether it does

Re: Buggy behavior of recur with primitives

2009-06-28 Thread Meikel Brandmeyer
Hi, Am 28.06.2009 um 07:53 schrieb Handkea fumosa: The recur arg in question is (+ (* G__12815 G__12815) (* G__12817 G__12816 G__12816) G__12819) all of whose operands are doubles. This seems buggy. Yes, that seems ominous. I'm not doing much number crunching (read: I don't need tight

Re: ClassCastException - maybe a bug

2009-06-28 Thread Laurent PETIT
Hi, I can understand both points of vue, since the documentation is not explicit about the possibility to return an error ? (contains? coll key) Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java

Re: java.ext.dirs problem

2009-06-28 Thread Christophe Grand
Hi all, On Sun, Jun 28, 2009 at 1:37 AM, Laurent PETIT laurent.pe...@gmail.comwrote: That's certainly why you're having problems when you mess up the dependencies in places where there is a hierarchy of classloaders involved : clojure-contrib was loaded with the main classloader along

Re: java.ext.dirs problem

2009-06-28 Thread Laurent PETIT
2009/6/28 Christophe Grand christo...@cgrand.net: Hi all, On Sun, Jun 28, 2009 at 1:37 AM, Laurent PETIT laurent.pe...@gmail.com wrote: That's certainly why you're having problems when you mess up the dependencies in places where there is a hierarchy of classloaders involved :

Re: Buggy behavior of recur with primitives

2009-06-28 Thread Jarkko Oranen
On Jun 28, 8:53 am, Handkea fumosa hfum...@gmail.com wrote: (defn foo [z-r z-i c-r c-i bailout max-iters]   (let [G__12819 (double c-r)         G__12820 (double c-i)         G__12817 (double -1)         G__12818 (double 2)         mi (int max-iters)         b (double (* bailout bailout))]

Re: ClassNotFoundException turn up randomly at compilation

2009-06-28 Thread Michael Wood
2009/6/26 C. Florian Ebeling florian.ebel...@gmail.com: Hi, I randomly get ClassNotFoundExceptions when I try to compile a file. This is a paste from the repl: Clojure 1.0.0- user= (compile 'app.hello) java.lang.RuntimeException: java.lang.ClassNotFoundException: app.hello$exec__4

Re: (for [binds] body) violates convention for non-conditional binding forms

2009-06-28 Thread Rich Hickey
On Sun, Jun 28, 2009 at 12:19 AM, Handkea fumosahfum...@gmail.com wrote: user= (doall  (for [x (range 2) y (range 2)]    (println x @ y)    (* x y))) Expected: 0 @ 0 0 @ 1 1 @ 0 1 @ 1 (0 0 0 1) Got: #CompilerException java.lang.IllegalArgumentException: Wrong number of args

Re: Bug: (list? (cons 4 '(1 2 3))) returns false!

2009-06-28 Thread Rich Hickey
On Sun, Jun 28, 2009 at 2:26 AM, Meikel Brandmeyerm...@kotka.de wrote: Hi, Am 28.06.2009 um 07:45 schrieb Handkea fumosa: It's list? that isn't. No. list? is not broken. Every list is a seq, but not every seq is a list. Consider: (cons 0 (iterate inc 1)) This is no list! It's a

Re: ClassCastException - maybe a bug

2009-06-28 Thread Rich Hickey
On Sat, Jun 27, 2009 at 4:30 PM, Handkea fumosahfum...@gmail.com wrote: On Jun 27, 11:32 am, Meikel Brandmeyer m...@kotka.de wrote: Am 26.06.2009 um 23:44 schrieb Michael Spiegel: =(def foo (sorted-set bob alice michael)) = (contains? foo 5) java.lang.ClassCastException: java.lang.String

Re: Buggy behavior of recur with primitives

2009-06-28 Thread Rich Hickey
On Sun, Jun 28, 2009 at 8:35 AM, Jarkko Oranenchous...@gmail.com wrote: On Jun 28, 8:53 am, Handkea fumosa hfum...@gmail.com wrote: (defn foo [z-r z-i c-r c-i bailout max-iters]   (let [G__12819 (double c-r)         G__12820 (double c-i)         G__12817 (double -1)         G__12818

Re: Buggy behavior of recur with primitives

2009-06-28 Thread Handkea fumosa
On Jun 28, 2:47 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 28.06.2009 um 07:53 schrieb Handkea fumosa: The recur arg in question is  (+ (* G__12815 G__12815) (* G__12817 G__12816 G__12816) G__12819) all of whose operands are doubles. This seems buggy. Yes, that seems ominous.

Re: ClassCastException - maybe a bug

2009-06-28 Thread Handkea fumosa
On Jun 28, 11:27 am, Rich Hickey richhic...@gmail.com wrote: Deducing it doesn't contain 5 because it was passed a key incomparable to some other key seems like a stretch to me, and bug-hiding. Clojure is relatively free of exception catching in normal flow of control, and I'm disinclined to

Re: Bug: (list? (cons 4 '(1 2 3))) returns false!

2009-06-28 Thread Handkea fumosa
On Jun 28, 1:49 am, Richard Newman holyg...@gmail.com wrote: cons is acting according to its documentation. It's list? that isn't. That's not strictly true Are you calling me a liar? Is there a reason why you are testing for listiness rather than for   some other property, like

Re: (for [binds] body) violates convention for non-conditional binding forms

2009-06-28 Thread Handkea fumosa
On Jun 28, 11:03 am, Rich Hickey richhic...@gmail.com wrote: Now that doseq has similar capabilities, I think the situation you've put forth (side effects and keeping lazy result) will be an extreme minority case, and am inclined to think it would be better to require and see the 'do' so you

Re: Bug: (list? (cons 4 '(1 2 3))) returns false!

2009-06-28 Thread Handkea fumosa
On Jun 28, 11:21 am, Rich Hickey richhic...@gmail.com wrote: This too is a bit much. The OP wasn't trying to use cons as a pair, just expecting list? to be more similar to listp. It's a reasonable mistake, please be gentle. If you're referring to me, I don't agree that it is a mistake to

Re: Bug: (list? (cons 4 '(1 2 3))) returns false!

2009-06-28 Thread Rich Hickey
On Jun 28, 11:52 am, Handkea fumosa hfum...@gmail.com wrote: On Jun 28, 1:49 am, Richard Newman holyg...@gmail.com wrote: cons is acting according to its documentation. It's list? that isn't. That's not strictly true Are you calling me a liar? Is there a reason why you are

Re: ClassCastException - maybe a bug

2009-06-28 Thread Stephen C. Gilardi
On Jun 28, 2009, at 11:48 AM, Handkea fumosa wrote: On Jun 28, 11:27 am, Rich Hickey richhic...@gmail.com wrote: Deducing it doesn't contain 5 because it was passed a key incomparable to some other key seems like a stretch to me, and bug-hiding. Clojure is relatively free of exception

Re: Bug: (list? (cons 4 '(1 2 3))) returns false!

2009-06-28 Thread Richard Newman
It's list? that isn't. That's not strictly true Are you calling me a liar? Not a liar; just misinformed, as I hope I demonstrated by citing the docs. I don't see any value in continuing this thread of the discussion, but I wanted to clear that up. If you don't think list? should be

Re: Bug: (list? (cons 4 '(1 2 3))) returns false!

2009-06-28 Thread Handkea fumosa
On Jun 28, 12:14 pm, Richard Newman holyg...@gmail.com wrote: It's list? that isn't. That's not strictly true Are you calling me a liar? Not a liar; just misinformed I don't agree. --~--~-~--~~~---~--~~ You received this message because you are

Re: What are people using Clojure for?

2009-06-28 Thread Michael Böckling
Hi Howard, I'd be interested to know what you think of Enlive (http:// wiki.github.com/cgrand/enlive/). On first sight it looks like pure genius, and the philosophy reminds me of Tapestry5. T5 nicely decouples Java user code from the framework by using IoC, callbacks, naming conventions and

Troll in our midst - please ignore them

2009-06-28 Thread Rich Hickey
It has become obvious to me we now have a troll in our midst, known first as Wrexsoul, then Four of Seventeen, and now Handkea fumosa. In spite of their desire for anonymity, their posts identify them for us: Posting too often At too great a length, often histrionically and provocatively With

How to shorten clojure.lang.* classes

2009-06-28 Thread samppi
I use Clojure's classes a lot in my multimethods. Is there any way to abbreviate them; that is, is there a method to refer to clojure.lang.APersistentList as APersistentList? I've tried (use 'clojure.lang) and (require ['clojure.lang :as 'c]), but neither seem to work.

Re: (for [binds] body) violates convention for non-conditional binding forms

2009-06-28 Thread Meikel Brandmeyer
Hi, Am 28.06.2009 um 18:06 schrieb Handkea fumosa: Well, that error bit me when I was doing some debugging, which involved precisely putting a println into a for block. The results were being consumed more or less immediately. The net effect was to waste a little bit of my time. For such

Re: How to shorten clojure.lang.* classes

2009-06-28 Thread Stephen C. Gilardi
On Jun 28, 2009, at 3:03 PM, samppi wrote: I use Clojure's classes a lot in my multimethods. Is there any way to abbreviate them; that is, is there a method to refer to clojure.lang.APersistentList as APersistentList? I've tried (use 'clojure.lang) and (require ['clojure.lang :as 'c]), but

Re: How to shorten clojure.lang.* classes

2009-06-28 Thread Krešimir Šojat
They are standard java classes, so you should use import: (import '(clojure.lang APersistentList)) (defmethod my-method APersistentList [ _] ...) On 28 lip, 21:03, samppi rbysam...@gmail.com wrote: I use Clojure's classes a lot in my multimethods. Is there any way to abbreviate them; that

Re: Troll in our midst - please ignore them

2009-06-28 Thread Alex Combas
Hi Rich, Does this mean you're going to be moderating every post, or just posts from new accounts? Either way, perhaps you could start looking around for a couple of people who would do this job of moderating for you because I'm sure I'm not alone in thinking that your time would be best used

Re: Troll in our midst - please ignore them

2009-06-28 Thread CuppoJava
Hi Rich, I'm very impressed by the effort you put in to moderating and supporting the community, on top of your work on Clojure. I did notice that Wrexsoul, Four, and Handkea's posts were tending to the annoying, but I didn't think to attribute them as being the same person. Do you have a way of

Re: How to shorten clojure.lang.* classes

2009-06-28 Thread samppi
Wonderful. Thanks for the answers. On Jun 28, 12:39 pm, Stephen C. Gilardi squee...@mac.com wrote: On Jun 28, 2009, at 3:03 PM, samppi wrote: I use Clojure's classes a lot in my multimethods. Is there any way to abbreviate them; that is, is there a method to refer to

Re: ClassNotFoundException turn up randomly at compilation

2009-06-28 Thread C. Florian Ebeling
I randomly get ClassNotFoundExceptions when I try to compile a file. This is a paste from the repl: Clojure 1.0.0- user= (compile 'app.hello) java.lang.RuntimeException: java.lang.ClassNotFoundException: app.hello$exec__4 (NO_SOURCE_FILE:0) user= (compile 'app.hello) app.hello I'm

Re: Troll in our midst - please ignore them

2009-06-28 Thread Daniel Renfer
On Sun, Jun 28, 2009 at 4:51 PM, CuppoJavapatrickli_2...@hotmail.com wrote: Hi Rich, I'm very impressed by the effort you put in to moderating and supporting the community, on top of your work on Clojure. I did notice that Wrexsoul, Four, and Handkea's posts were tending to the annoying,

Re: Troll in our midst - please ignore them

2009-06-28 Thread Giancarlo Angulo
I didn't know this! thanks! = ANGOL = -|-^...@^_^, =|+^_^X++~_~,@- The only thing worse than a hopeless romantic is a hopeful one Magbasa bago Mamuna. Mag-isip bago mambatikos Without Truth there is no Justice, Without Justice, there is Tyranny Semper fi Proof of Desire

Article on Dispatch

2009-06-28 Thread Daniel Jomphe
I think the following article I wrote may help properly understanding dispatch. I submit here for your pleasure/review. First paragraph: I believe multiple dispatch is known to be hard to understand. When I first read about it, for some reason, it took me quite a lot of thinking before I really

Re: Troll in our midst - please ignore them

2009-06-28 Thread CuppoJava
Thank you Denfer, That's a very interesting trick. I'm sure it'll be handy to me in the future. I really never considered trolls a possibility on this forum. It seems if that sort of thing interests you, there's much easier and satisfying prey elsewhere. -Patrick

Re: Troll in our midst - please ignore them

2009-06-28 Thread Alex Combas
On Sun, Jun 28, 2009 at 10:21 PM, CuppoJava patrickli_2...@hotmail.comwrote: Thank you Denfer, That's a very interesting trick. I'm sure it'll be handy to me in the future. I really never considered trolls a possibility on this forum. It seems if that sort of thing interests you, there's