Re: Using memory with futures

2017-09-05 Thread Didier
Everything tbc++ said, But also, if you create futures at a faster rate then they terminate, you will eventually run out of memory, because futures are unbounded. If that's the case, you want to use ThreadPoolExecutor to create a bounded pool or a pool backed by a queue and then use it as expla

Re: Question regarding core.logic

2017-09-05 Thread Laverne Schrock
On Tuesday, September 5, 2017 at 1:50:59 PM UTC-5, Russell Mull wrote: > > On Monday, September 4, 2017 at 7:49:11 AM UTC-7, Laverne Schrock wrote: >> >> When I run (run* [q] (fresh [x] (== [x] ['z]) (== q x))), I get (z), >> which makes sense. >> >> When I run (run* [q] (fresh [x] (== q x))), I

Re: Using memory with futures

2017-09-05 Thread Timothy Baldridge
Every thread created on the JVM takes about 2MB of memory. Multiply that by that number of threads, and I'm surprised your memory usage is that low. But the futures thread pool will also re-use previously created threads for new futures. In order to optimize this, a certain number of threads will b

Re: A Failure To Understand lazy-seq

2017-09-05 Thread Dan Burton
I'll try and explain. This explanation isn't perfectly rigorous, but may be close enough. (def fibs (lazy-seq (cons 0 (cons 1 (map +' fibs (rest fibs)) This creates a thunk, deferring execution of the body of `lazy-seq`. (first fibs) This forces the thunk, let's call it THUNK1. In order to fo

Re: Writing an Android application with Clojure

2017-09-05 Thread Didier
> > ​I know Java and C++. A long time ago I worked with Pascal. > > What I like about Kotlin is that it is less verbose. And Clojure is > of-course even less verbose. :-D > Oh yea, and Kotlin exists pretty much only to address Java's verbosity, and maybe a few small other quirks, and it did a g

Re: Question regarding core.logic

2017-09-05 Thread Russell Mull
On Monday, September 4, 2017 at 7:49:11 AM UTC-7, Laverne Schrock wrote: > > When I run (run* [q] (fresh [x] (== [x] ['z]) (== q x))), I get (z), > which makes sense. > > When I run (run* [q] (fresh [x] (== q x))), I get (_0), which makes sense > since I've placed no restriction on x. > > However

Re: transducers and eduction

2017-09-05 Thread Peter Hull
On Tuesday, 5 September 2017 12:11:04 UTC+1, Christophe Grand wrote: > > > Hope this helps. > That is very helpful to me. It would be great if those tips could be added to the official documentation. Pete -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: Writing an Android application with Clojure

2017-09-05 Thread Cecil Westerhof
2017-09-03 20:23 GMT+02:00 Didier : > Kotlin is actually officialy supported on Android, so definitly a good > choice there. ​I started with Kotlin. I think I first learn to write some applications for Android and then decide if I want to switch to Clojure(Script). ​ > That said, if you know

Re: transducers and eduction

2017-09-05 Thread Christophe Grand
Hi, the naming of your args [x r] is a bit confusing as x is usually the second item and the first is often caled acc (and it's also the argument passed to the completing arity (1-arg)). However acc is a name inherited from reduce and does not really represent its actual purpose. *You have to cons

Re: Writing an Android application with Clojure

2017-09-05 Thread Srihari Sriraman
> Well, in the last 2 years I think React Native has grown quite a bit. So has Clojurescript, and the rapport between them. See https://groups.google.com/forum/#!msg/clojure/4wz8d1FJ9tU/rBZpEqt_AAAJ if you're looking for a case-study with some magnitude. My personal experience in building out 3

Re: transducers and eduction

2017-09-05 Thread Peter Hull
On Tuesday, 5 September 2017 00:07:07 UTC+1, Alex Miller wrote: > > When you say "the" answer here, that doesn't make sense to me. > Nor me. But, I think I've got it now, thanks for your help. The question I should have asked was "what is the purpose of the ([x] ...) arity in an eduction?" I wi