Re: How to compose futures?

2011-09-11 Thread Laurent PETIT
Hello, Would it make sense to use instead promise/deliver, and enque computations in order in agents queues ? (worse parallelism, but more control over the number of threads ?) 2011/9/10 Illim illminou...@gmail.com I'm a clojure beginner and from the future api , the only way I found to

Re: How to compose futures?

2011-09-11 Thread Kevin Downey
I hate to see agents used this way. If people want a thread pool they should either use the ones provided by clojure, or create their own. Using agents when you want a thread pool smacks of ignorance. http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html You

Re: How to compose futures?

2011-09-11 Thread Laurent PETIT
2011/9/11 Kevin Downey redc...@gmail.com I hate to see agents used this way. If people want a thread pool they should either use the ones provided by clojure, or create their own. That's right, the agents part of my answer is more a hack. But the more interesting point I wanted to bring to

Re: How to compose futures?

2011-09-11 Thread Kevin Downey
what you were suggesting, if I understand correctly, is re-implementing futures using agents instead of a thread pool. send an action off to an agent to be run, return a promise, the action delivers to the promise when the action completes. derefing the promise blocks until the action is run to

Re: How to compose futures?

2011-09-11 Thread Laurent PETIT
Hi, now that I've stepped back a little bit and acknowledged my ignorance (while working on it : currently reading Java concurrency in practice :-) ), I can see why I've been so prompt to suggest that (while I can remember having said to others that using agents without caring about their state

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Michael Jaaka
There should be an initiative to built own ide, look at Java history, it become popular when good ide with debugers, docs, highlighting and refactoring appeared. Clojure should have such ide, my vote right now is for clooj, since this is the only one ide written in supported language itself. Just

Re: How to compose futures?

2011-09-11 Thread Illim
Imho, using agents(or fixed size thread pool) in my case could be worst than using an unbounded thread pool. There's a risk to have all agents blocked waiting for each other. The library die-geister seems to perfectly fit my needs. Great! Still I would be grateful to hear a solution using only the

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Sam Aaron
Hi Curran, I made this video for hacking Overtone with Emacs: http://vimeo.com/25190186 However, Overtone can just be viewed as an example project - it's really just a description of how to get a working Clojure/Emacs setup. Sam --- http://sam.aaron.name On 10 Sep 2011, at 18:29, Curran

Re: What's wrong with my *print-dup* persistence?

2011-09-11 Thread Jonathan Fischer Friberg
Or (load-string (+ 1 (+ 2 4))) Jonathan On Fri, Sep 9, 2011 at 5:14 PM, Chouser chou...@gmail.com wrote: On Thu, Sep 8, 2011 at 5:16 PM, Tassilo Horn tass...@member.fsf.org wrote: Hi all, I've just read Alan Malloy's excellent clojure persistence article at

Re: debugging

2011-09-11 Thread Jonathan Fischer Friberg
Sort of. http://georgejahad.com/clojure/cdt.html Jonathan On Sat, Sep 10, 2011 at 5:36 PM, Dennis Haupt d.haup...@googlemail.comwrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi there, what's the currently best way to debug a clojure program? ideally, i want to see all vars,

Re: Misleading Exception due to function name containing -

2011-09-11 Thread Jonathan Fischer Friberg
I've had no problems with functions containing - Jonathan On Fri, Sep 9, 2011 at 10:47 AM, Christina Conway ccon...@annadaletech.comwrote: A function name contains the characters - e.g. foo-fn The function causes an exception. However the exception is not reported on the function but on

Re: puzzlement over lazy sequences

2011-09-11 Thread Stuart Halloway
Hi George, Once again, I make a globally referenced, infinitely long stream. But now I use lazy-seq instead of cycle: user= (def ev-stream (lazy-seq (cons true (cons false ev- stream #'user/ev-stream user= (defn ev? [n] (nth ev-stream n)) #'user/ev? user= (time

Re: Misleading Exception due to function name containing -

2011-09-11 Thread Baishampayan Ghose
The foo-fn function is compiled to a .class file as: foo__GT_fn.class The foofn function is compiled to a .class file as: foo_GT_fn.class The foo-fn function is compiled to a .class file as: foo_fn.class Has anybody else encountered this with function names containing -. Is this a bug?

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread David Nolen
As an avid Emacs user - don't bother. If you just want a no hassle environment that supports Clojure development use Clooj. Steps - 1) Download 2) Double-click https://github.com/arthuredelstein/clooj David On Sat, Sep 10, 2011 at 1:29 PM, Curran curran.kelle...@gmail.com wrote: Greetings,

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Vincent
+1 -- 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 members are moderated - please be patient with your first post. To unsubscribe from this group, send email to

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Phil Hagelberg
I don't know why an error message doesn't show, but the swank clojure readme explains a fallback method (lein swank + M-x slime-connect) that you could try. -Phil -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread kjeldahl
I use Emacs for virtually everything, but have found that Emacs +Clojure is less than idea when working with multiple threads (like hosting and running a Jetty server). I believe this is mostly related to how Java and Emacs+Slime handles input/output redirection. I went crazy trying to figure out

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Sam Aaron
On 11 Sep 2011, at 16:37, kjeldahl wrote: I use Emacs for virtually everything, but have found that Emacs +Clojure is less than idea when working with multiple threads (like hosting and running a Jetty server). I believe this is mostly related to how Java and Emacs+Slime handles input/output

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread kjeldahl
Yes, I had better success with cake (when I used it). But with the lein setup, I believe most of it goes into a swank buffer of some sort, which also contain a lot of other (non-related) output, and exactly where in that buffer it also ends up seems a bit undeterministic. But again, just my

Exceptions in Haskell and in Clojure

2011-09-11 Thread Michael Jaaka
Couldn't match expected type `(t, t1)'   against inferred type `(t2, t3, t4)'   In the expression: (8, 11, 5)   In the expression: [(1, 2), (8, 11, 5), (4, 5)]   In the definition of `it': it = [(1, 2), (8, 11, 5), (4, 5)]   This was excerpt from Haskell exception, will Clojure have ever

Re: An open call to the community: Let's prepare for 1.3

2011-09-11 Thread Phil Hagelberg
On Mon, Sep 5, 2011 at 1:26 PM, Stefan Kamphausen ska2...@googlemail.com wrote: could you please elaborate a bit on the swank-clojure issue?  Alternatively just point me to the threads that I should have read more closely. Now that Leiningen has user-level plugins, there's no need to put swank

Re: How to compose futures?

2011-09-11 Thread Sean Corfield
On Sun, Sep 11, 2011 at 1:29 AM, Laurent PETIT laurent.pe...@gmail.com wrote: now that I've stepped back a little bit and acknowledged my ignorance (while working on it : currently reading Java concurrency in practice :-) ) Kevin pulled me up on this too (in IRC) and pointed me at the Java

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Phil Hagelberg
On Sun, Sep 11, 2011 at 9:09 AM, kjeldahl mariusauto-googlegro...@kjeldahl.net wrote: with the lein setup, I believe most of it goes into a swank buffer of some sort, which also contain a lot of other (non-related) output, and exactly where in that buffer it also ends up seems a bit

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread kjeldahl
Have you looked at the *swank* buffer? Maybe your's is looking differently than mine, but there's lots of stuff that I did not but there, and which I would not have there. My issues with this is related to running servers and catching debug output from it while it is running (yeah, I really

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Sam Aaron
On 11 Sep 2011, at 22:42, kjeldahl wrote: I'm no expert, but if I had to choose between getting all output in a file, or some output in the repl buffer and some in *swank*, I would prefer the former (which is what I believe cake actually does). Used from within Emacs, cake places all output

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Phil Hagelberg
On Sun, Sep 11, 2011 at 2:42 PM, kjeldahl mariusauto-googlegro...@kjeldahl.net wrote: Have you looked at the *swank* buffer? Maybe your's is looking differently than mine, but there's lots of stuff that I did not but there, and which I would not have there. Everything in there is output from

Re: puzzlement over lazy sequences

2011-09-11 Thread Ken Wesson
On Sun, Sep 11, 2011 at 8:28 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: cycle actually calls lazy-seq.  A quick way to check such things at the REPL is with source: user= (source cycle) (defn cycle   Returns a lazy (infinite!) sequence of repetitions of the items in coll.   {:added

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Daniel Pittman
On Sat, Sep 10, 2011 at 10:29, Curran curran.kelle...@gmail.com wrote: I would greatly appreciate any guidance on where to find a working and complete set of instructions for how to set up Emacs with swank- clojure. I am in Ubuntu. I have followed exactly every step of the instructions on

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Sean Toner
Hi Curran, I'm in the process of learning Clojure and emacs as well and have run into a bit of difficulty as well, though I have a slightly different problem. I grabbed the 23.3 version of emacs from their ftp site and did NOT use the emacs starter kit. I discovered that the version of

Functional Programming eXchange 2012: Call for abstracts

2011-09-11 Thread Robert Pickering
Hello all, I’m sending this email to several mailing lists so my apologies if you see this twice. Functional Programming eXchange is a developer conference that focuses on functional programming. The 2012 edition will take place on Friday March 16th March 2012, at the Skills Matter eXchange, in

Re: An open call to the community: Let's prepare for 1.3

2011-09-11 Thread Anthony Grimes
Cake's global project allows for dev deps to be set for all projects, so this applies to cake as well. -- 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 members are

Re: puzzlement over lazy sequences

2011-09-11 Thread George Kangas
Hi, Stu, Loving your book! I posted a reply earlier, through a different interface, which went to moderators. Sorry for the clumsiness, but I'm not familiar with the mechanics of newsgroups. On Sep 11, 7:28 am, Stuart Halloway stuart.hallo...@gmail.com wrote: The consing version of

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Curran
Greetings, Wow, thank you all so much for the insightful responses to my inquiry! I really appreciate the supportive community. I developed a small web app in Clooj over the weekend and was very impressed by it! A very cool idea to write the IDE for the language, in the language, with the

Re: How to compose futures?

2011-09-11 Thread Kevin Downey
Clojure's concurrency primitives are built on the functionality provided by java.util.concurrent and I think solutions for asynchronous composition should also be built on java.util.concurrent. Agents are identities over a series of results from asynchronous function application. Nothing about

clojure tutorial for haskell programers?

2011-09-11 Thread Michael Jaaka
Hi, when i first came to clojure world i've started with tutorial for java programers, now i'm reading about haskell and for almost every new feature I know that my favorite language clojure already has that, but i'm not fully sure which feature it is. For example comprehensions are implemented by

Re: puzzlement over lazy sequences

2011-09-11 Thread Alan Malloy
Integer overflow. user (mod 9876543210 (bigint (Math/pow 2 32))) 1286608618 On Sep 11, 9:44 pm, George Kangas gwkan...@gmail.com wrote: I believe the bug can be blamed on nth. Using nth, I make a function which should be identity on natural numbers: Clojure 1.2.1 user= (defn ident [n]

Clojure sort: is it specified to be stable for all targets?

2011-09-11 Thread Daniel Pittman
G'day. The API documentation for clojure doesn't specify if the sort method is stable, unstable, or implementation defined. Java defines sort to be stable, but Clojure also has two other targets, and I can't tell if I am safe making the assumption that the stable behaviour will carry over to

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread finbeu
Also, if I can't get Emacs going, would anyone suggest an alternative development tool? (I know there are lots, but I don't know which to try first). I use IntelliJ IDEA with La Clojure and Leiningen plugin. I usually create a skeleton project with leiningen on the command line, then