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

Re: Simple Clojure/Java interop

2011-04-18 Thread Meikel Brandmeyer
Hi, On 18 Apr., 09:43, MohanR radhakrishnan.mo...@gmail.com 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

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

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) at

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 asdf

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

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

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 te...@terjedahl.no wrote: I would very much like to study and understand

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 not want

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

2011-04-18 Thread James Reeves
On 18 April 2011 16:47, Laurent PETIT laurent.pe...@gmail.com 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

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 laurent.pe...@gmail.com 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

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 laurent.pe...@gmail.com 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

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

2011-04-18 Thread Sean Corfield
On Mon, Apr 18, 2011 at 9:33 AM, James Reeves jree...@weavejester.com 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

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

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

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 paul.degran...@gmail.com 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

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 think the

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, 2011

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 dave...@gmail.com wrote: Hi, For the

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 for

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

2011-04-18 Thread Laurent PETIT
2011/4/19 Rich Hickey richhic...@gmail.com: 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