list of open source clojure projects to contribute?
I am just thinking if anyone can list up open source projects so one can pick and work on? -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
List quasi-quoting
Hi, I'm prototyping a source translation framework in Clojure and I've run across a problem. I have a bunch of files with s-expression data and I'd like to define my own macro expanders for that data, like this: (defmacro defexpander [sym args body] `(let [fun# (fn ~args ~...@body)] (add-expander! '~sym fun#))) (defexpander foo [tree] `(+ ~@(rest tree) +)) ;;; (foo bar) - (+ bar +) add-expander! is a function that squirrels away the symbol-expander mapping for future use when the transformations are being run. Now much to my confusion, the syntax-quote operator doesn't produce a list, but a cons, with symbols resolved. I assume this was to simplify macro handling internally within Clojure? Is there a way to do a proper list quasi quote exansion? Currently I have to write (defexpander foo [tree] (list '+ (rest tree) '+)) which just doesn't scale beyond simple expressions. Thanks, Andreas -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: list of open source clojure projects to contribute?
Here's a good start: http://www.google.com/search?hl=enq=site:github.com+clojure But the best plan is to start using clojure for real work, then contribute to the open source tools you find yourself using. -Steve On 23 Dec 2009, at 02:27, Kasim wrote: I am just thinking if anyone can list up open source projects so one can pick and work on? -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
My belated Xmas gift
Hello All, I wanted something that could help make life a little easier for me, that was what motivated me to write the below code. However, when I showed it to a friend, he pointed out that clojure 1.1 has juxt function. So, I quickly changed its name to apply-juxt. I invite your comments and if you like it please use it. Merry Christmas!! (defn apply-juxt [d body] (map #(apply % body) d)) (apply-juxt [* - +] 8 7) Regards, Emeka -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
ANN: clojure-maven-plugin 1.3 Released
'lo all, Just a notification that the clojure-maven-plugin 1.3 was released earlier today (shortly following 1.2 after a glaring regression was found). Main changes: - An automatically generated test script is generated when no testScript/ is mentioned in the config, this runs and fails the build nicely. - Fixes problems with multi-builds and not prepending the ${basedir} to mentioned paths - Support for enabling warn-on-reflection when compiling Mark -- Pull me down under... -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Stream processing
Here's a new piece I wrote about stream processing in Clojure. It's rushed and incomplete, just like the library. But I'm not going to have time to do much work on things after Christmas, so I wanted to get it out in case it might inspire others. http://intensivesystems.net/tutorials/stream_proc.html This is only a quick overview with a few hints of what it could be used for, so don't expect too much from it. Merry Christmas, Jim -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Recommendation for Clojure Indentation tool
Hi, On Dec 22, 11:48 am, Gabi bugspy...@gmail.com wrote: I need a simple command-line tool to indent Clojure source files. Any recommendation ? there was a post to a ruby script for some OSX editor which provided the Clojure indentation by calling emacs in batch-mode. Unfortunately I can't find it anymore. Sorry. Anyone else remember? Regards, Stefan -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Using map on multiple collections.
It's a little shorter if you unconditionally concat repeat. (defn append-val [val colls] (let [maxlen (apply max (map count colls))] (map #(concat % (repeat (- maxlen (count %)) val)) colls))) user (apply map + (append-val 0 [1] [2 3] [4 5 6])) (7 8 6) -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: list of open source clojure projects to contribute?
Steve Purcell st...@sanityinc.com writes: http://www.google.com/search?hl=enq=site:github.com+clojure Also noteworthy: all Clojure projects on Github sorted by most recent activity: http://github.com/languages/Clojure/updated That weeds out inactive projects. But the best plan is to start using clojure for real work, then contribute to the open source tools you find yourself using. That too. If you're interested in a web app using Compojure, the Clojars project might be a good place to start: http://github.com/ato/clojars-web -Phil -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: List quasi-quoting
I try to avoid using reading macros in macro definitions. Maybe you could wrap the desired data in a quote form instead? On Dec 23, 6:13 am, Andreas Fredriksson deplineno...@gmail.com wrote: Hi, I'm prototyping a source translation framework in Clojure and I've run across a problem. I have a bunch of files with s-expression data and I'd like to define my own macro expanders for that data, like this: (defmacro defexpander [sym args body] `(let [fun# (fn ~args ~...@body)] (add-expander! '~sym fun#))) (defexpander foo [tree] `(+ ~@(rest tree) +)) ;;; (foo bar) - (+ bar +) add-expander! is a function that squirrels away the symbol-expander mapping for future use when the transformations are being run. Now much to my confusion, the syntax-quote operator doesn't produce a list, but a cons, with symbols resolved. I assume this was to simplify macro handling internally within Clojure? Is there a way to do a proper list quasi quote exansion? Currently I have to write (defexpander foo [tree] (list '+ (rest tree) '+)) which just doesn't scale beyond simple expressions. Thanks, Andreas -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Why use monads
I'd appreciate any added detail, since I had a similar reaction to Chouser, thus wasn't really grokking the monad (wikipedia's description is no more helpful). On Dec 22, 2:10 pm, jim jim.d...@gmail.com wrote: Chouser, You're right that maybe-comp is simpler. Once you realize that the functions you want to compose are monadic functions under the maybe-m monad, you get that composition for 'free', with no further mental effort. With such a simple example, it's hard to see the benefit, but with more complicated monads the difference between the monad composition and ad-hoc style becomes greater. Where the ad-hoc version would have to be debugged, the monad version would already be proven to be correct. Beyond that, there are other things that you get 'for free' by using the monad functions. Don't have time to enumerate them now but might later. Jim On Dec 22, 3:14 pm, Chouser chou...@gmail.com wrote: It's interesting to me that the definition of maybe-comp above is arguably simpler that the definition of maybe-m, even without counting the machinery of 'defmonad'. Presumably this is a hint to how much more powerful maybe-m is than maybe-comp, and simply shows I don't yet understand the power of monads. --Chouser -- -- I funded Clojure 2010, did you? http://clojure.org/funding -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Why use monads
+1 ataggart, Chouser On Dec 23, 3:02 pm, ataggart alex.tagg...@gmail.com wrote: I'd appreciate any added detail, since I had a similar reaction to Chouser, thus wasn't really grokking the monad (wikipedia's description is no more helpful). On Dec 22, 2:10 pm, jim jim.d...@gmail.com wrote: Chouser, You're right that maybe-comp is simpler. Once you realize that the functions you want to compose are monadic functions under the maybe-m monad, you get that composition for 'free', with no further mental effort. With such a simple example, it's hard to see the benefit, but with more complicated monads the difference between the monad composition and ad-hoc style becomes greater. Where the ad-hoc version would have to be debugged, the monad version would already be proven to be correct. Beyond that, there are other things that you get 'for free' by using the monad functions. Don't have time to enumerate them now but might later. Jim On Dec 22, 3:14 pm, Chouser chou...@gmail.com wrote: It's interesting to me that the definition of maybe-comp above is arguably simpler that the definition of maybe-m, even without counting the machinery of 'defmonad'. Presumably this is a hint to how much more powerful maybe-m is than maybe-comp, and simply shows I don't yet understand the power of monads. --Chouser -- -- I funded Clojure 2010, did you? http://clojure.org/funding -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: eval performance
If you are doing GP, another approach to avoid using eval would be using a tree of closures. http://xach.livejournal.com/131456.html is an example of the technique used in Common Lisp (should be similar enough). -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Why use monads
I'll see what I can do. On Dec 23, 2:18 pm, Sean Devlin francoisdev...@gmail.com wrote: +1 ataggart, Chouser -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: list of open source clojure projects to contribute?
BitBucket (the GitHub of Mercurial) has a few pages of Clojure-based projects: http://bitbucket.org/repo/all/?name=clojure On Dec 22, 9:27 pm, Kasim ktu...@gmail.com wrote: I am just thinking if anyone can list up open source projects so one can pick and work on? -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Why use monads
I've expanded the tutorial a little. You can skip to Another example for the new stuff. I go through the same exercise using the probability monad. http://intensivesystems.net/tutorials/why_monads.html There are some corresponding additions to the sample code as well. Jim On Dec 23, 2:18 pm, Sean Devlin francoisdev...@gmail.com wrote: +1 ataggart, Chouser On Dec 23, 3:02 pm, ataggart alex.tagg...@gmail.com wrote: I'd appreciate any added detail, since I had a similar reaction to Chouser, thus wasn't really grokking the monad (wikipedia's description is no more helpful). On Dec 22, 2:10 pm, jim jim.d...@gmail.com wrote: Chouser, You're right that maybe-comp is simpler. Once you realize that the functions you want to compose are monadic functions under the maybe-m monad, you get that composition for 'free', with no further mental effort. With such a simple example, it's hard to see the benefit, but with more complicated monads the difference between the monad composition and ad-hoc style becomes greater. Where the ad-hoc version would have to be debugged, the monad version would already be proven to be correct. Beyond that, there are other things that you get 'for free' by using the monad functions. Don't have time to enumerate them now but might later. Jim On Dec 22, 3:14 pm, Chouser chou...@gmail.com wrote: It's interesting to me that the definition of maybe-comp above is arguably simpler that the definition of maybe-m, even without counting the machinery of 'defmonad'. Presumably this is a hint to how much more powerful maybe-m is than maybe-comp, and simply shows I don't yet understand the power of monads. --Chouser -- -- I funded Clojure 2010, did you? http://clojure.org/funding -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
:pre and :post throwing Exception - is this a smell?
'lo, I was reading http://blog.fogus.me/2009/12/21/clojures-pre-and-post/ on the new pre and post conditions and seeing that they throw java.lang.Exception kinda struck me as a bad smell, esp. when integrating with other systems written in Java or another language. Forcing upstream clients to catch the top level Exception seems rather rude on clojures part. Was there any reason java.lang.Exception was used over say java.lang.AssertionError? Or a more specific PreConditionAssertionError/PostConditionAssertionError pair? Mark -- Pull me down under... -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
SQL addition: connection input
I just started using Proxool, and c.c.sql doesn't offer a way to either pass in a connection object, or to construct a JDBC URI that starts with anything but 'jdbc:'. Here's a patch that allows {:connection my connection} as a valid DB spec. I've tested it out and it seems to work fine. Should I create a ticket? -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en sql.patch Description: Binary data
Re: new API webpage format
I found another missing function: fmap. I notice these things because still don't know Clojure very well, but I work with someone that does. Thus, as I have time to work on it, I end up spending a fair amount of time trying to figure out his code. -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: :pre and :post throwing Exception - is this a smell?
It would be nice if the exception string stated if it was a pre or post condition failure at the very least. On Dec 23, 5:03 pm, Mark Derricutt m...@talios.com wrote: 'lo, I was readinghttp://blog.fogus.me/2009/12/21/clojures-pre-and-post/ on the new pre and post conditions and seeing that they throw java.lang.Exception kinda struck me as a bad smell, esp. when integrating with other systems written in Java or another language. Forcing upstream clients to catch the top level Exception seems rather rude on clojures part. Was there any reason java.lang.Exception was used over say java.lang.AssertionError? Or a more specific PreConditionAssertionError/PostConditionAssertionError pair? Mark -- Pull me down under... -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: SQL addition: connection input
Hi Richard, On Wed, Dec 23, 2009 at 5:31 PM, Richard Newman holyg...@gmail.com wrote: I just started using Proxool, and c.c.sql doesn't offer a way to either pass in a connection object, or to construct a JDBC URI that starts with anything but 'jdbc:'. Here's a patch that allows {:connection my connection} as a valid DB spec. I've tested it out and it seems to work fine. Should I create a ticket? Already ticketed and patched. Not sure what the release schedule is, though. http://www.assembla.com/spaces/clojure-contrib/tickets/50 Best, Graham -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: SQL addition: connection input
Already ticketed and patched. Not sure what the release schedule is, though. http://www.assembla.com/spaces/clojure-contrib/tickets/50 Awesome, thanks Graham! -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Using map on multiple collections.
On Dec 23, 12:30 pm, kyle smith the1physic...@gmail.com wrote: It's a little shorter if you unconditionally concat repeat. (defn append-val [val colls] (let [maxlen (apply max (map count colls))] (map #(concat % (repeat (- maxlen (count %)) val)) colls))) user (apply map + (append-val 0 [1] [2 3] [4 5 6])) (7 8 6) Thanks for the suggestion. -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Probability Monad
Hey Konrad, I was looking at the probability monad today and think this definition of m-bind might be easier to understand. (defmonad dist-m [m-result (fn m-result-dist [v] {v 1}) m-bind (fn m-bind-dist [mv f] (reduce (partial merge-with +) (for [[x p] mv [y q] (f x)] {y (* q p)}))) ]) What do you think? Also, I was thinking about cond-dist-m. What if dist-m was redefined to be this (defmonad dist-m [m-result (fn m-result-dist [v] {v 1}) m-bind (fn m-bind-dist [mv f] (if (empty? mv) {} (reduce (partial merge-with +) (for [[x p] mv [y q] (f x)] {y (* q p)} m-zero {} m-plus (fn m-plus-dist [ mvs] (if-let [mv (first (drop-while empty? mvs))] mv {})) ]) I think that would roll cond-dist-m into dist-m, eliminating the need for a seperate monad. Don't know if you'd thought of that and discarded it or not. Love the work you've done to bring monads to Clojure. Jim -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: :pre and :post throwing Exception - is this a smell?
Hi, I've written a related patch that makes three changes: 1. assert now raises AssertionError, instead of Exception. 2. assert is now overloaded with a second parameter that replaces Assert failed in the original message. 3. the (pre- or post-) condition that raised the exception, along with the form responsible, is now reported. Previously: Caused by: java.lang.Exception: Assert failed: (= % x) Now: Caused by: java.lang.AssertionError: Postcondition failed when (bad- fn 2): (= % x) Assembla seems to be having some problems, so I'm hosting it at http://fanatico.org/better-pre-post.diff until they get that sorted out. Thoughts? On Dec 23, 3:52 pm, Sean Devlin francoisdev...@gmail.com wrote: It would be nice if the exception string stated if it was a pre or post condition failure at the very least. On Dec 23, 5:03 pm, Mark Derricutt m...@talios.com wrote: 'lo, I was readinghttp://blog.fogus.me/2009/12/21/clojures-pre-and-post/ on the new pre and post conditions and seeing that they throw java.lang.Exception kinda struck me as a bad smell, esp. when integrating with other systems written in Java or another language. Forcing upstream clients to catch the top level Exception seems rather rude on clojures part. Was there any reason java.lang.Exception was used over say java.lang.AssertionError? Or a more specific PreConditionAssertionError/PostConditionAssertionError pair? Mark -- Pull me down under... -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
NPE in reify.
The following generates an NPE during compilation: (deftype Small []) (defn wrap [] (reify Small)) Obviously, my real use has more interfaces I implement, but this shows the problem. My problem is that I need to override 'print-method', which is using defmulti off of 'type' of it's argument. I guess I could also implement IMeta and provide a tag as well. But, the workaround I've been using is to create an empty interface in Java, which reify is happy to implement. David -- 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en