Re: rebinding fn definitions not effective in lambdas?

2009-10-05 Thread Meikel Brandmeyer
Hi, On Oct 6, 1:23 am, MarkSwanson wrote: > I wonder if this concept will be thought of as a source of problems in > the future. Or, maybe this is just one of those fundamental Clojure > concepts you just have to learn and once you do you find you don't get > bit by it. This is a side-effect o

Re: Memory Characteristics of Persistent Datastructures

2009-10-05 Thread Meikel Brandmeyer
Hi, Am 06.10.2009 um 00:55 schrieb Mark Tomko: To be explicit, the doall needs to be before the call to recur (that is, it affects the map). Is that right? Yes. It must look like (recur (doall (map ...))). Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature

Re: Does OSGi make sense for Clojure?

2009-10-05 Thread Mark Derricutt
I do have a novel idea to work around this but I've yet to put my theory to code and publish it. The problems I had when loading clojure based bundles into OSGi was that after unloading, the classes remained loaded by the bundle providing RT. The basic idea was to add a bundle listener to the OSG

Re: Linear Algebra Package

2009-10-05 Thread Garth Sheldon-Coulson
I develop Clojuratica. Kyle---I had no idea it works with Player. That's cool and interesting. Patrick---If you're doing straight-up numerical matrix algebra and require the greatest possible performance you'll probably do best with Parallel Colt. There's no time spent on data-type conversion and

Re: rebinding fn definitions not effective in lambdas?

2009-10-05 Thread Michael Beauregard
At first glance this is surprising to me and I'm sure I would be tripped up by this at least a few times before I finally learned my lesson. On Mon, Oct 5, 2009 at 5:23 PM, MarkSwanson wrote: > > To expand on Meikel's nice explanation: > (to see if I understand correctly) > > 1. (defn baz ...) >

Re: Linear Algebra Package

2009-10-05 Thread CuppoJava
Thanks for the replies. Those are exactly what I need! -Patrick --~--~-~--~~~---~--~~ 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 from new

Re: Does OSGi make sense for Clojure?

2009-10-05 Thread Jeff Heon
There is this project going on: http://wiki.github.com/romanroe/ogee --~--~-~--~~~---~--~~ 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 from

Re: Linear Algebra Package

2009-10-05 Thread Mark Reid
Hi, I think http://sites.google.com/site/piotrwendykier/software/ parallelcolt">Parallel Colt has picked up where Colt left off. It's a very full featured library and forms the basis of the Clojure stats package http://incanter.org/>Incanter. Personally, I've used the sparse vector classes in Pa

Re: rebinding fn definitions not effective in lambdas?

2009-10-05 Thread MarkSwanson
To expand on Meikel's nice explanation: (to see if I understand correctly) 1. (defn baz ...) 2. (binding [foo bar] (baz [1 2 3])) - dynamically binds foo and creates a lazy-seq response to the baz fn. Because map is lazy the [1 2 3] sequence is actually not read by anything within the binding d

Re: Memory Characteristics of Persistent Datastructures

2009-10-05 Thread Mark Tomko
To be explicit, the doall needs to be before the call to recur (that is, it affects the map). Is that right? On Oct 5, 1:31 am, Meikel Brandmeyer wrote: > Hi, > > On Oct 5, 9:50 am, Volkan YAZICI wrote: > > > > (defn leak [] > > >   (loop [v [0 0]] > > >     (recur (map + v [1 1] > > > >

Re: Linear Algebra Package

2009-10-05 Thread kyle smith
clojuratica works with the free mathematica player. I don't think there are any licensing issues, but I could be wrong. I need to do more benchmarking, but the performance is pretty good so far. --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: rebinding fn definitions not effective in lambdas?

2009-10-05 Thread Meikel Brandmeyer
Hi, Am 05.10.2009 um 20:37 schrieb Daniel Janus: (defn baz [s] (map (fn [_] (foo)) s)) user=> (binding [foo bar] (baz [1 2 3])) (42 42 42) ;; while I would expect (44 44 44). Am I missing something here? You are missing lazyness. The (42 42 42) is printed at the Repl. That realises the seq

rebinding fn definitions not effective in lambdas?

2009-10-05 Thread Daniel Janus
Dear Clojurians, Consider the following three simple functions: (defn foo [] 42) (defn bar [] 44) (defn baz [s] (map (fn [_] (foo)) s)) Now let's rebind foo to bar: user=> (binding [foo bar] (foo)) 44 ;; Just as I expected. user=> (binding [foo bar] (baz [1 2 3])) (42 42 42) ;; while I would e

Linear Algebra Package

2009-10-05 Thread CuppoJava
Hi, I need to do some high performance numerical data crunching and was wondering what libraries are popular. I have looked into Colt and JAMA, but neither have had much development recently (Colt hasn't had a release since 2004, and JAMA since 2005), and I'm not sure if they're still alive. Cloju

Re: Agent send-off: ~20k/s

2009-10-05 Thread John Harrop
On Mon, Oct 5, 2009 at 11:51 AM, MarkSwanson wrote: > On Oct 5, 2:45 am, ngocdaothanh wrote: > > I think it is not "spawn about 20K agents / second", it is 20K message > > passings / second. The number is about that of Erlang. > > As Clojure uses a thread pool for agents I agree 'spawn' was the w

Re: apply for macros?

2009-10-05 Thread John Harrop
On Mon, Oct 5, 2009 at 2:38 PM, Meikel Brandmeyer wrote: > Hi, > > Am 05.10.2009 um 19:29 schrieb cody koeninger: > > Here we have the smell! You cannot define functions with a function. >>> You have to use a macro! >>> >> >> I am not clear on what you mean by this. From a user's point of view,

Re: Does OSGi make sense for Clojure?

2009-10-05 Thread Stuart Sierra
It's possible to modify Clojure to run under OSGi (search the list archives) but fundamentally they don't fit. OSGi assumes that it has sole control of class loading. But Clojure needs its own classloader. To make them cooperate, I think you would need to integrate Clojure with the OSGi contain

Re: apply for macros?

2009-10-05 Thread Meikel Brandmeyer
Hi, Am 05.10.2009 um 19:29 schrieb cody koeninger: Here we have the smell! You cannot define functions with a function. You have to use a macro! I am not clear on what you mean by this. From a user's point of view, what is the difference between defining a function, and interning a var with

Re: Memory Characteristics of Persistent Datastructures

2009-10-05 Thread Raoul Duke
> You're right, it was a memory leak, although it took me hours to find. > Clojure's lazy lists were responsible for the leak; I wasn't honestly > expecting this innocent looking code to be so insidious $0.02 another instance of this that makes me think laziness needs to be explicit in the sy

Re: apply for macros?

2009-10-05 Thread cody koeninger
On Oct 4, 1:31 am, Meikel Brandmeyer wrote: > Here we have the smell! You cannot define functions with a function.   > You have to use a macro! I am not clear on what you mean by this. From a user's point of view, what is the difference between defining a function, and interning a var with a fn

Re: Adding meta data to string?

2009-10-05 Thread Jung Ko
On Sat, Oct 3, 2009 at 7:23 AM, pmf wrote: > > And String is final, making deriving from it impossible. > > One way (most probably not the best way) would be to wrap it in a Var > and attach the metadata to the Var, i.e. > > (def #^{:blah :foo} my-string "some string") > > Note that to access th

Re: On

2009-10-05 Thread Chouser
On Sun, Oct 4, 2009 at 4:41 PM, samppi wrote: > > I want to do this: > >  (defn a ...) >  (cache a) ; or (cache #'a) or (cache 'a); it doesn't matter to me > > ...instead of this: > >  (def a (memoize (fn ...))) > > That way, it separates the concern of what a does from the > optimization I'm doi

Re: Agent send-off: ~20k/s

2009-10-05 Thread MarkSwanson
On Oct 5, 2:45 am, ngocdaothanh wrote: > I think it is not "spawn about 20K agents / second", it is 20K message > passings / second. The number is about that of Erlang. As Clojure uses a thread pool for agents I agree 'spawn' was the wrong word. Thanks for the correction. --~--~-~--~---

Does OSGi make sense for Clojure?

2009-10-05 Thread Todor Boev
Hi, I am an OSGi enthusiast. Lately I have been looking at scheme and clojure. I can't help but wonder if there are any genuine benefits clojure can get from being a full OSGi citizen. It seems to me that OSGi is to statically compiled Java what the REPL is for Clojure. Except the REPL is more pow

Re: Multimethod or Multiple Arg Lists

2009-10-05 Thread Robert Stehwien
> > > (dosync (dorun (for [key ks] (alter file-seq-cache dissoc key >> > > You might want to write (dorun (for ...)) as (doseq ...). Since you don't > use the resulting sequence using for to generate sequence and then using to > dorun to force it and immediately throw it away is very ugly.

Re: Problems With VimClojure (Minimal Example Included)

2009-10-05 Thread Meikel Brandmeyer
Hi, On Oct 5, 11:02 am, Tim Sally wrote: > At the moment I'm only interested in the documentation lookup   > functions, so I did not start the nailgun server.  I had assumed that   > the nailgun server was only necessary for evaluating code, but I   > didn't read the README carefully enough.  S

Re: Problems With VimClojure (Minimal Example Included)

2009-10-05 Thread Tim Sally
Hi, At the moment I'm only interested in the documentation lookup functions, so I did not start the nailgun server. I had assumed that the nailgun server was only necessary for evaluating code, but I didn't read the README carefully enough. Starting the server was the missing step. Tha

Re: Memory Characteristics of Persistent Datastructures

2009-10-05 Thread Meikel Brandmeyer
Hi, On Oct 5, 9:50 am, Volkan YAZICI wrote: > > (defn leak [] > >   (loop [v [0 0]] > >     (recur (map + v [1 1] > > > Adding a doall call fixed the leak. > > Could you please provide a more concrete (if possible working) example? > I'm trying to figure out the actual reason of the problem

Re: Problems With VimClojure (Minimal Example Included)

2009-10-05 Thread Meikel Brandmeyer
Hi, On Oct 5, 12:14 am, Tim Sally wrote: > I'm having a problem getting VimClojure working.  I've tried with both > the development and stable versions.  For this minimal example, I use > the stable version and ivy to resolve the dependencies.  However I > have tried installing with a correct l

Re: On

2009-10-05 Thread John Harrop
On Sun, Oct 4, 2009 at 4:41 PM, samppi wrote: > > I want to do this: > > (defn a ...) > (cache a) ; or (cache #'a) or (cache 'a); it doesn't matter to me > > ...instead of this: > > (def a (memoize (fn ...))) > > That way, it separates the concern of what a does from the > optimization I'm doi

Problems With VimClojure (Minimal Example Included)

2009-10-05 Thread Tim Sally
Hey all, I'm having a problem getting VimClojure working. I've tried with both the development and stable versions. For this minimal example, I use the stable version and ivy to resolve the dependencies. However I have tried installing with a correct local.properties file as well with no luck.

Re: Memory Characteristics of Persistent Datastructures

2009-10-05 Thread Volkan YAZICI
On Sun, 4 Oct 2009, Elliott Slaughter writes: > You're right, it was a memory leak, although it took me hours to find. > Clojure's lazy lists were responsible for the leak; I wasn't honestly > expecting this innocent looking code to be so insidious > > (defn leak [] > (loop [v [0 0]] >