Re: Simple Clojure/Java interop

2011-04-18 Thread MohanR
This method that makes a simple call to the log4j library throws an exception even though the message it written to the file. Not sure if there has something to do with static methods again. user>( defn logtrace[message]( (let [logger (org.apache.log4j.LogManager/getLogger "Stream")]( .log l

Re: Simple Clojure/Java interop

2011-04-18 Thread Meikel Brandmeyer
Hi, On 18 Apr., 09:43, MohanR wrote: > user>( defn logtrace[message]( ; <- paren? >   (let [logger (org.apache.log4j.LogManager/getLogger "Stream")]( >     .log logger org.apache.log4j.Level/FATAL message >   ) > )) ; <- paren? > ) You don't say what the exception is, but I suspect a NPE. If it

Re: Simple Clojure/Java interop

2011-04-18 Thread MohanR
Thanks. There is no NPE now. -- 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 th

newbie question

2011-04-18 Thread lesni bleble
hello, i'm trying to start learning clojure with lein but i get into trouble. I'm doing simple project: > lein new foo > cd foo > lein deps > echo '(println "hello")' >> src/foo/core.clj > lein run -m foo.core hello Exception in thread "main" java.lang.NullPointerException (NO_SOURCE_FILE:1)

Re: newbie question

2011-04-18 Thread Ambrose Bonnaire-Sergeant
Hi, lein run looks for a -main function in your source file. This is a convention borrowed from java (and other languages). The null pointer exception is probably lein or clojure looking for -main. > echo '(defn -main [] (println "no exception)' >> src/foo/core.clj > lein run -m foo.core hello a

Re: newbie question

2011-04-18 Thread semperos
To use lein run, you need to do two things: 1) Write a -main function (defn -main [] ... ) in whatever namespace you like (you could put it in the core namescape, like you did in your echo statement for the (println "foo")). For example: (defn -main [] (println "foo")) 2) Specify which names

RE: Help with function to partition my data

2011-04-18 Thread Bhinderwala, Shoeb
(Sent the below email earlier but for some reason didn't make it to the list) I wasn't aware of the group-by function. Being new to clojure, I spent a lot of time coming up with my complex function. Seeing the one line solution really blew me away. Thanks!! Follow up questions on my problem (my

Re: Understanding the Clojure source-code and functionality

2011-04-18 Thread Armando Blancas
You may want to follow this thread and look for the latest version of Clojure in Small Pieces: http://groups.google.com/group/clojure/browse_thread/thread/460417fe45f314c3/db1e7b58031efc7e On Apr 17, 12:27 pm, Terje Dahl wrote: > I would very much like to study and understand how Clojure works >

Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Laurent PETIT
Hello, The -?> and -?>> macros are currently inside "old", "soon to be deprecated" clojure contrib. They have proven useful to me a number of times, and I personnally wouldn't see them stay in the soon "deprecated" , "not maintained anymore" old clojure contrib repo/jar. (Not to say that I would

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread James Reeves
On 18 April 2011 16:47, Laurent PETIT wrote: > So the question is: do a sufficiently important number of other people > use and want them as well  ? If so, I may ask to the clojure-dev ml if > and how and/or where we could move this macro so that it is still > visible and `usable`. I use it, and

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Zach Tellman
I definitely find them useful. On Apr 18, 8:47 am, Laurent PETIT wrote: > Hello, > > The -?> and -?>> macros are currently inside "old", "soon to be > deprecated" clojure contrib. > > They have proven useful to me a number of times, and I personnally > wouldn't see them stay in the soon "deprecat

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Wilson MacGyver
I use -?> quite often. On Mon, Apr 18, 2011 at 11:47 AM, Laurent PETIT wrote: > Hello, > > The -?> and -?>> macros are currently inside "old", "soon to be > deprecated" clojure contrib. > > They have proven useful to me a number of times, and I personnally > wouldn't see them stay in the soon "de

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Sean Corfield
On Mon, Apr 18, 2011 at 9:33 AM, James Reeves wrote: > I use it, and I think more people would use it if this were in core. I only discovered them recently - they would certainly be more discoverable in core and that would lead to greater use (so the question then will be whether Clojure/core con

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Konrad Hinsen
On 18 Apr 2011, at 17:47, Laurent PETIT wrote: The -?> and -?>> macros are currently inside "old", "soon to be deprecated" clojure contrib. I must confess that I don't even know what those macros do, so I have no opinion. However, I think the question of "what will happen to module cloju

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Paul deGrandis
I very much like the -?> and -?>> macros and fine them pretty useful. I'd support their addition into core. Also, regarding Konrad's comment: I also find a lot of random one-off things in old contrib that I think are useful to use as well as to read through some of the source. I think something l

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread László Török
+1 for Konrad's Monad library sent from my mobile device On Apr 18, 2011 9:19 PM, "Paul deGrandis" wrote: > I very much like the -?> and -?>> macros and fine them pretty useful. > I'd support their addition into core. > > Also, regarding Konrad's comment: > I also find a lot of random one-off th

Feedback Request

2011-04-18 Thread Dave Ray
Hi, For the last few weeks, I've been working on a Clojure Swing wrapper called Seesaw. I've learned a lot about Clojure so far, but I think it's time to ask for some feedback. If I wait 'til it's perfect or complete, ... well, then no one would ever hear from me. The code can be found on github

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Rich Hickey
On Apr 18, 2011, at 2:49 PM, Konrad Hinsen wrote: On 18 Apr 2011, at 17:47, Laurent PETIT wrote: The -?> and -?>> macros are currently inside "old", "soon to be deprecated" clojure contrib. I must confess that I don't even know what those macros do, so I have no opinion. However, I thin

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Sean Corfield
> On Apr 18, 2011, at 2:49 PM, Konrad Hinsen wrote: >> If nothing else is decided collectively, I'll maintain them as private >> projects on Google Codes or Bitbucket. If they don't end up as part of the new lineup of contrib libraries, would you at least keep them on github.com? On Mon, Apr 18,

Re: Feedback Request

2011-04-18 Thread Rayne
I haven't had a chance to look over more than the README, but I was actually considering writing something like this myself. Before I progress any further, I must say: thank you so much for doing this so that I don't have to. On Apr 18, 5:57 pm, Dave Ray wrote: > Hi, > > For the last few weeks, I

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Paul deGrandis
Rich, Thanks for the feedback and righting some things for me. Can you speak to the -?> and -?>> macros, specifically if you think nil should be handled differently, or if these macros code find a new home in core? That said, I'd happily pitch in and help maintain a handful of the contrib libs f

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Laurent PETIT
2011/4/19 Rich Hickey : > > On Apr 18, 2011, at 2:49 PM, Konrad Hinsen wrote: > >> On 18 Apr 2011, at 17:47, Laurent PETIT wrote: >> >>> The -?> and -?>> macros are currently inside "old", "soon to be >>> deprecated" clojure contrib. >> >> I must confess that I don't even know what those macros do,

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Konrad Hinsen
On 19 Apr 2011, at 03:02, Sean Corfield wrote: On Apr 18, 2011, at 2:49 PM, Konrad Hinsen wrote: If nothing else is decided collectively, I'll maintain them as private projects on Google Codes or Bitbucket. If they don't end up as part of the new lineup of contrib libraries, would you at le

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Konrad Hinsen
On 19 Apr 2011, at 02:15, Rich Hickey wrote: The only criterion for migrating into new contrib is someone willing to do the work of moving, and, subsequently, maintaining. OK, thanks for the clarification! Stuart Sierra has documented the process here: http://dev.clojure.org/display/design

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Sean Corfield
On Mon, Apr 18, 2011 at 11:25 PM, Konrad Hinsen wrote: > I'll try to see if I can manage to migrate to new contrib (I am not exactly > looking forward to all those new tools to learn) I hadn't needed to deal with maven until I tried to set up clojure.java.jdbc - but that was the only piece I was

Re: Feedback Request

2011-04-18 Thread Alfredo
I haven't look nothing but the REAME too, but the project seems promising :) Good work and keep improving it! Alfredo On Apr 19, 3:23 am, Rayne wrote: > I haven't had a chance to look over more than the README, but I was > actually considering writing something like this myself. Before I > progr

Re: Future of clojure.contrib.core/-?> macro

2011-04-18 Thread Michael Wood
On 19 April 2011 08:25, Konrad Hinsen wrote: > On 19 Apr 2011, at 03:02, Sean Corfield wrote: > >>> On Apr 18, 2011, at 2:49 PM, Konrad Hinsen wrote: If nothing else is decided collectively, I'll maintain them as private projects on Google Codes or Bitbucket. >> >> If they don't end