clojurescript why: (def ... is failing whereas (let ... succeeds

2012-02-10 Thread billh2233
I don't understand (def someVar (newInstantiatedGoogFxObject...)). Why does (def someVar (new-goog-fx-object ...)) fail whereas (let [somevar (new-goog-fx-object ...) ] works? I'm trying to define a variable using def and instantiate a new goog.fx.DragDrop, but this clojurescript: (def dragSo

Re: -> and ->>

2012-02-10 Thread j1n3l0
You can always check out clojuredocs.org: http://clojuredocs.org/clojure_core/clojure.core/-> http://clojuredocs.org/clojure_core/clojure.core/->> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

Re: Persistent collections and garbage collection

2012-02-10 Thread Patrick Moriarty
Hi Ron, I've profiled a 20k line Clojure application and have never seen anything like what you seem to be suggesting. It seems (though you've not been very clear) that you suspect that persistent collections may be holding references to nodes longer than necessary. That is, longer than a mutab

Re: protocols and interfaces

2012-02-10 Thread drewn
> There's also defrecord I considered using that, but I need to do something more with the constructor (e.g. convert the map into a Java array for internal use). Also, defrecords only takes positional arguments, which will be hard to use with tens of arguments. (An alternative is just to pass in

Re: novice question, performance surprise

2012-02-10 Thread Manuel Paccagnella
On 02/09/2012 11:40 PM, Steve Miner wrote: filter is lazy so it won't actually do the work unless the values are needed. To get a reasonable time, you need to use the result for some computation. Try something like this: (defn sum-all [m] (reduce + (apply map + (vals m (time (sum-all (s

Re: Quicksort

2012-02-10 Thread Nathan Sorenson
Obviously the example of doall not being up to the task should read: scratch> (type (doall (lazy-seq [1 2 3]))) clojure.lang.LazySeq -- 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 th

Re: Quicksort

2012-02-10 Thread Nathan Sorenson
Couple of things to watch out for, Clojure doesn't pattern match on the args in the way you seem to be expecting, so this will blow the stack (i.e. calling qsort with the empty list won't call the 0-argument method you have there.) The error you're running into is that pop/peek isn't defined fo

Quicksort

2012-02-10 Thread nahiluhmot
Hello all, I'm very new to clojure, so to familiarize myself I decided to try to implement the quicksort. My code looks like this: (defn qsort ([] nil) ([list] (let[piv(peek list) f-half (filter (fn [n] (<= n piv))

Re: Print only by clojure code

2012-02-10 Thread Simone Mosciatti
Hi Tassilo, i tried your macro and its work perfectly, thank you. On 9 Feb, 01:57, Tassilo Horn wrote: > Cedric Greevey writes: > > Hi Cedric, > > >> Just in case the java lib in fact uses System.out/err directly, one > >> can redirect standard out and error to something else. > > >> (with-open

Re: protocols and interfaces

2012-02-10 Thread Cedric Greevey
On Fri, Feb 10, 2012 at 1:07 PM, Aaron Cohen wrote: > On Fri, Feb 10, 2012 at 3:13 AM, drewn wrote: >> I've just started learning protocols, deftype, etc.  The first thing I >> did was try to extend a Clojure type (maps) to operate as a >> specialized Java Swing interface (AttributeSet), forgetti

Re: Print only by clojure code

2012-02-10 Thread Simone Mosciatti
Hi Tassilo, i tried your macro and its work perfectly, thank you. On 9 Feb, 01:57, Tassilo Horn wrote: > Cedric Greevey writes: > > Hi Cedric, > > >> Just in case the java lib in fact uses System.out/err directly, one > >> can redirect standard out and error to something else. > > >> (with-open

Re: protocols and interfaces

2012-02-10 Thread Aaron Cohen
On Fri, Feb 10, 2012 at 3:13 AM, drewn wrote: > I've just started learning protocols, deftype, etc.  The first thing I > did was try to extend a Clojure type (maps) to operate as a > specialized Java Swing interface (AttributeSet), forgetting that > interfaces are not protocols; i.e. > > (extend-t

Re: protocols and interfaces

2012-02-10 Thread drewn
> Nope, can't be done. Java interfaces can't do this. I'm glad I asked the question. Given that it can't be done, any suggestions for the best way of handling this interop scenario? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: Persistent collections and garbage collection

2012-02-10 Thread Armando Blancas
Not sure if I understand your concern since I wonder how's that different from, say, some ephemeral Java collection that happens to be around after a given generational threshold and then becomes unreachable. On Feb 10, 4:01 am, pron wrote: > And have you profiled the objects making it to the old

Re: Clojure on PyPy

2012-02-10 Thread Timothy Baldridge
>> I have some set of algorithms that needs such-and-such operations to be as fast as possible. Can I create a VM that is tailored for that? Yes, this is basically what PyPy does for Regexes, they have a custom regex engine that has "can_enter_jit" in it. So basically what you get is a jitted rege

Re: protocols and interfaces

2012-02-10 Thread Stuart Sierra
Nope, can't be done. Java interfaces can't do this. Java 8 may have "Interface Injection" which will make this possible. -S -- 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

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-10 Thread Sean Neilan
On Thu, Feb 9, 2012 at 8:20 PM, Phil Hagelberg wrote: > Sean Neilan writes: > > > It's on the github page at the top. > > Forgive me if I'm slow, but I can't find it. Can you be more specific? > > The canonical page for swank-clojure is > https://github.com/technomancy/swank-clojure > > Sorry ab

Call for Papers: European Lisp Symposium 2012, Zadar, Croatia

2012-02-10 Thread Marco Antoniotti
European Lisp Symposium 2012, Zadar, Croatia, April 30th - May 1st, 2012 PAPER SUBMISSION DEADLINE APPROACHING http://european-lisp-symposium.org The purpose of the European Lisp Symposium is to provide a forum for the discussion and dissemination of all aspects of design, implementation and app

Re: Persistent collections and garbage collection

2012-02-10 Thread pron
And have you profiled the objects making it to the old generation (requiring/causing the full GC)? Are persistent collection nodes a significant part of those? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

protocols and interfaces

2012-02-10 Thread drewn
I've just started learning protocols, deftype, etc. The first thing I did was try to extend a Clojure type (maps) to operate as a specialized Java Swing interface (AttributeSet), forgetting that interfaces are not protocols; i.e. (extend-type clojure.lang.PersistentArrayMap javax.swing.text.Att