Re: Is this a good idea? (merging let, cond and -)

2011-04-15 Thread Alan
Someone implements ilet every couple of months on the mailing list. It gets a little support as like well that could be handy, but the consensus seems to be that the value it adds is not much greater than the complexity it adds. So some people keep their own private versions that they use for

Re: call to idiomatic loop works as stand alone but not when wrapped in my function

2011-04-15 Thread Alan
I would do it by making read-files-into-memory take a single argument, a list of filenames, rather than N arguments, each of which is a filename. Just drop the in the function's definition and you should be done. On Apr 14, 4:21 pm, Avram aav...@me.com wrote: Yes, I am missing a way to turn the

Re: Very odd memory allocation behavior

2011-04-15 Thread Alan
Holy cow wall of text. I really couldn't get through the whole thing, but I scanned it and I don't see you mentioning output-stream buffering, which would be one of my primary suspects for this sort of behavior. Sorry if you've already considered this. As for why it allocated a bunch of heap: if

odd reflection warning

2011-04-15 Thread Jules
I've reduced a compile-time reflection warning that I am getting to the following : put this in a file and compile it (I am using clojure-1.3.0alpha5 and clojure-maven-plugin-1.3.7) : (ns org.dada.demo.mytest) (if true (do (def ^java.util.Collection some-numbers [0 23 45 64 67 78])

Re: Adding key values in a list of maps

2011-04-15 Thread Laurent PETIT
For some people this might read better also : user= (- p (map :b) (reduce +)) 9 2011/4/15 Andreas Kostler andreas.koestler.le...@gmail.com: Or: (reduce #(+ %1 (:b %2)) 0 p) :) On Apr 15, 10:51 am, Andreas Kostler andreas.koest...@leica- geosystems.com wrote: (reduce + (map :b p)) Cheers

Re: Adding key values in a list of maps

2011-04-15 Thread Ulises
user= (- p (map :b) (reduce +)) Alternatively: user (def p '({:a 1 :b 2 :c 4}, {:a 2 :b 3 :c 5}, {:a 3 :b 4 :c 6})) #'user/p user (:b (apply merge-with + p)) 9 Depending on whether you'll want the other sums or not, this approach might be appropriate. U -- You received this message because

Re: Cyber Dungeon Quest Alpha 1

2011-04-15 Thread Wei Hsu
Very cool! I really enjoyed playing it. On Apr 14, 12:20 pm, Alan a...@malloys.org wrote: Similar error for me, on Ubuntu. Exception and wrapped exception follow. Looks like you may need permissions set better? 403 is Forbidden. com.sun.deploy.net.FailedDownloadException: Unable to load

Re: def and ;dynamic

2011-04-15 Thread David McNeil
Thank you for your solution, but can you explain why it works ? As best I recall... in Clojure 1.3 vars are no longer dynamic by default. In the short-term, to ease the pain of this change, Clojure 1.3 will automatically make vars with earmuffs (e.g. *foo*) into dynamic variables. But it warns

Re: def and ;dynamic

2011-04-15 Thread Jules
Aha ! Thanks, David. Now I can sort all those annoying warnings :-) Jules -- 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

Re: You should fix this before next release!

2011-04-15 Thread Stuart Sierra
If you're referring to clojure-contrib in its current, monolithic form, it is all deprecated. New development is happening in new, per-library repositories at http://github.com/clojure -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups

Re: odd reflection warning

2011-04-15 Thread Jules
I don't get it if I type into a repl - only when I put it into a file and compile it... It's been hanging around for a while so I figured it was time to get to the bottom of it :-) Jules -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: odd reflection warning

2011-04-15 Thread Jules
Originally I thought it might be something to do with the overload on the TreeSetT ctor expecting a CollectionT when I am probably only able to provide Collection, but then I discovered the wierdness around the 'if'... Jules -- You received this message because you are subscribed to the

Re: odd reflection warning

2011-04-15 Thread Stuart Sierra
It's definitely not caused by the generics: they're a fiction of javac, and Clojure ignores them completely. -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 from new

Re: odd reflection warning

2011-04-15 Thread Laurent PETIT
2011/4/15 Jules jules.gosn...@gmail.com: I've reduced a compile-time reflection warning that I am getting to the following : put this in a file and compile it (I am using clojure-1.3.0alpha5 and clojure-maven-plugin-1.3.7) : (ns org.dada.demo.mytest) (if true   (do     (def

Re: You should fix this before next release!

2011-04-15 Thread Hugo Duncan
On Fri, 15 Apr 2011 09:28:39 -0400, Stuart Sierra the.stuart.sie...@gmail.com wrote: If you're referring to clojure-contrib in its current, monolithic form, it is all deprecated. New development is happening in new, per-library repositories at http://github.com/clojure A couple of

Re: Very odd memory allocation behavior

2011-04-15 Thread Alex Miller
Presuming this is reproducible, you should enter this state, then take thread dumps (via ctrl-break, ctrl-\, jconsole, jstack, jvisualvm, etc). If you want more info on what's happening with gc, use -verbose:gc and/ or -XX:+PrintGCDetails If you want another level of analysis, use a performance

Re: You should fix this before next release!

2011-04-15 Thread Armando Blancas
I'm using: dependency groupIdorg.clojure.contrib/groupId artifactIdrepl-utils/artifactId version1.3.0-SNAPSHOT/version /dependency ... repository idclojure-snapshots/id urlhttp://build.clojure.org/snapshots/url /repository ... My user.clj has: (use

Re: You should fix this before next release!

2011-04-15 Thread Armando Blancas
New development is happening in new, per-library repositories athttp://github.com/clojure BTW, last night I noticed that this file hasn't been updated for 1.3: https://github.com/clojure/clojure-contrib/blob/master/modules/repl-utils/src/main/clojure/clojure/contrib/repl_utils/javadoc.clj but

Re: You should fix this before next release!

2011-04-15 Thread Stuart Sierra
On Apr 15, 9:53 am, Hugo Duncan duncan.h...@gmail.com wrote: Is there a policy as regards whether the new per-library repos will run   against clojure 1.2? New contrib libraries should work with any version of Clojure that has the necessary features (such as protocols). Are all contrib libs

Re: call to idiomatic loop works as stand alone but not when wrapped in my function

2011-04-15 Thread Avram
Thank-you, I think that works for me! I do need the to be able to take in a variable number of arguments, but it looks like I can call vec to convert this to a vector, then call the read-files-into- memory function that now will take a single argument. Such an elegant language but difficult to

Re: call to idiomatic loop works as stand alone but not when wrapped in my function

2011-04-15 Thread Alan
You never need when you are defining your own functions. It's equivalent to declaring that your function takes one argument, a vector, and then always wrapping up in a vector whatever args you want to use. On Apr 15, 11:05 am, Avram aav...@me.com wrote: Thank-you, I think that works for me!  I

Re: Clojure interest in Zurich

2011-04-15 Thread mrzepka
Great I'm also a clojure user and live near Zurich. Ready for clojure hacking anytime. See you soon, Maximilien On 14 Apr., 18:39, Nick Zbinden nick...@gmail.com wrote: Hi im not from zurich but I life near enough. There is no clojure user group (sadly). I acctualy don't know of anybody else

Re: Agent action queuing is asynchronous.

2011-04-15 Thread André Caron
Hi Ivan, Thanks for the tip. I'll get the polling solution working until Java 7 is supported by Clojure. I really want to see how well I can model different network protocols using Clojure's agents as asynchronous state machines, as this is why I started looking at Clojure in the first place.

Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Ptr6464
I'd like to second that. Since I started with Clojure it got me, but I need some practice, so if anyone needs enthusiastic workforce please let me know also. To Carin: Good luck in learning Clojure, should be pretty demanding but it will be great if we learn it. On Apr 15, 2:47 am, Carin Meier

Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Alex Robbins
I'm learning Clojure also, and have been working through some of the project euler problems. (Got started on it from the labrepl introduction.) It has been a lot of fun and I think I'm learning a fair amount about how the language works. http://projecteuler.net/index.php?section=problems I've

Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Alan
dbyrne is writing a sort of interactive learn clojure by problem- solving website at https://github.com/dbyrne/4clojure/. When he mentioned it to me I tweaked a few things, but it could use another hand or two. Especially, we're both dreadful web designers and so the pages look terrible. If

Re: Adding key values in a list of maps

2011-04-15 Thread Jeffrey Schwab
On Thursday, April 14, 2011 8:51:47 PM UTC-4, Andreas Kostler wrote: (reduce + (map :b p)) ; Or, save one character: (apply + (map :b p)) -- 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

Re: def and ;dynamic

2011-04-15 Thread Alan
I heard that this idea of automatically marking *foo* as dynamic had been dropped for the final 1.3 build. Did I misunderstand? Also, if Jules really liked those * characters in names, would it be an option to explicitly declare them ^{:dynamic false}? On Apr 15, 6:01 am, David McNeil

Re: Cyber Dungeon Quest Alpha 1

2011-04-15 Thread Julian
I looked at this and thought, It reminds me of Wyvern. The lead developer behind Wyvern, Steve Yegge, was a fairly visionary and expressive programmer who has written a lot about LISP and JVM related subjects. I was reminded of Steve Yegge's post on when he thought he'd rewrite Wyvern to reduce

Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Carin Meier
Thanks. Very cool project. On Apr 15, 5:49 pm, Alan a...@malloys.org wrote: dbyrne is writing a sort of interactive learn clojure by problem- solving website athttps://github.com/dbyrne/4clojure/. When he mentioned it to me I tweaked a few things, but it could use another hand or two.