Re: Partitioning a list when the result of a predicate becomes a certain value.

2012-05-12 Thread Ant
Thanks for the replies guys - has given me things to mull over. On Thursday, 10 May 2012 22:11:18 UTC+1, Ant wrote: Hi all, I am battering my head against the following problem which I'm sure is straightforward if only I knew how. I want to partition the following list: '(aa123 x y z

Re: How to configure a Clojure library at runtime?

2012-05-12 Thread James Thornton
On Saturday, May 12, 2012 12:44:45 AM UTC-5, Baishampayan Ghose wrote: There are many ways of doing this. One approach that I have seen a lot is something like this - ;; core.clj (def ^:dynamic *settings* {:default :stuff}) ;; the default settings can be nil I was experimenting

Re: How to configure a Clojure library at runtime?

2012-05-12 Thread Baishampayan Ghose
...but Andrew Cooke pointed out that using a global var would preclude you from being able to use multiple, independent graph instances in your program, whereas you can in the Python version (http://stackoverflow.com/questions/10540999/how-to-configure-a-clojure-library-at-runtime). And so I

{ANN} clj.monitor: monitoring applications in clojure

2012-05-12 Thread dennis zhuang
Hi,all I've implemented a simple DSL for monitoring apps in clojure based on SSH. Usage: goog_1871645686https://github.com/killme2008/clj.monitor An example: (defcluster mysql :clients [{:user deploy :host mysql.app.com}]) (defmonitor mysql-monitor ;;Tasks to monitor

Re: How to configure a Clojure library at runtime?

2012-05-12 Thread James Thornton
On Saturday, May 12, 2012 8:12:53 AM UTC-5, Baishampayan Ghose wrote: You got the basic idea right, that of creating a lexical closure over the config map. But I personally don't like the approach of returning a function that takes a function and applies it over the other args. I

Defining custom tags using hiccup ?

2012-05-12 Thread Murtaza Husain
Hi, I like the way hiccup allows you to represent html elements as datastructure. However this is limited to native elements. If you want to represent custom elements, the solution is to crate a function which will then spit out the basic html tags that hiccup compiler understands. It would

closure example doesn't need let?

2012-05-12 Thread larry
I saw this example of a simple closure in Joy of Clojure and on some Clojure tutorial page. (defn adder[n] (let [x n] (fn[y] (+ y x Is the let necessary? It seems redundant. I tried it like this and it seems to work fine. (defn adder[n] (fn[y] (+ y n)) -- You received this

Re: closure example doesn't need let?

2012-05-12 Thread Herwig Hochleitner
It's the same program. -- 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

Re: closure example doesn't need let?

2012-05-12 Thread Sean Corfield
On Sat, May 12, 2012 at 9:20 AM, larry larrye2...@gmail.com wrote: (defn adder[n]   (let [x n] (fn[y] (+ y x Is the let necessary?  It seems redundant. Can you provide a specific reference to where the example appears in Joy of Clojure (page number)? I assume the actual example in

Re: Leiningen 2.0.0-preview4

2012-05-12 Thread John Gabriele
On May 11, 10:02 pm, Phil Hagelberg p...@hagelb.org wrote: ## 2.0.0-preview4 / 2012-05-11 {snip} * Use Clojure 1.4.0 internally; plugins have access to new Clojure features. Hi Phil, After `lein self-install`, when I first ran `lein help` I get this output:

Re: [ANN] Exploding Fish: A URI Library for Clojure

2012-05-12 Thread Anthony Grimes
Aha! Thanks for explaining this here as well as in detail on IRC and working through it with me. It does indeed make sense. Furthermore, we've already had this discussion on IRC, but at least one person thought that my suggestions above were me being a jerk. Just wanted to publicly state here

Re: Leiningen 2.0.0-preview4

2012-05-12 Thread Phil Hagelberg
On Sat, May 12, 2012 at 11:06 AM, John Gabriele jmg3...@gmail.com wrote: After `lein self-install`, when I first ran `lein help` I get this output: https://www.refheap.com/paste/2697. Just a few questions: * What's the Clojure 1.3.0 jar required for if lein is using 1.4.0 internally? Some of

Re: [ANN] Exploding Fish: A URI Library for Clojure

2012-05-12 Thread Moritz Ulrich
Have you seen the recent buzz about java.net.URL's hashCode depending on the state of the internet[1]? Can Exploding Fish do something about this annoyance? [1]: http://michaelscharf.blogspot.de/2006/11/javaneturlequals-and-hashcode-make.html On Sat, May 12, 2012 at 10:40 PM, Anthony Grimes

Re: [ANN] Exploding Fish: A URI Library for Clojure

2012-05-12 Thread Walter Tetzner
On Saturday, May 12, 2012 6:28:14 PM UTC-4, Moritz Ulrich wrote: Have you seen the recent buzz about java.net.URL's hashCode depending on the state of the internet[1]? Can Exploding Fish do something about this annoyance? [1]:

Re: Leiningen 2.0.0-preview4

2012-05-12 Thread John Gabriele
On May 12, 4:41 pm, Phil Hagelberg p...@hagelb.org wrote: On Sat, May 12, 2012 at 11:06 AM, John Gabriele jmg3...@gmail.com wrote: By the way, I like that you can now pass extra args to `lein new` to create a project of a specific type (such as plugin). What do you think of adding 2 more

Re: Leiningen 2.0.0-preview4

2012-05-12 Thread Phil Hagelberg
On Sat, May 12, 2012 at 4:07 PM, John Gabriele jmg3...@gmail.com wrote:  * an app would have `:main foo.core` in the project.clj  * an app would have the `-main` function in core.clj  * an app would have a :gen-class in its ns declaration in core.clj Sure, that makes sense. Feel free to open

Re: Leiningen 2.0.0-preview4

2012-05-12 Thread John Gabriele
On May 12, 7:07 pm, John Gabriele jmg3...@gmail.com wrote: Whoops. Typo: Another important reason for having a good default README.md template specifically for libs is that, at some point, I'm guessing that clojars.org will extract and render them as html, and it will be nice if there's some

Re: [ANN] Exploding Fish: A URI Library for Clojure

2012-05-12 Thread Walter Tetzner
Second thing is your (ns ..) declarations. I've updated it to use :require instead of :use. -- 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: Defining custom tags using hiccup ?

2012-05-12 Thread James Reeves
On 12 May 2012 17:12, Murtaza Husain murtaza.hus...@sevenolives.com wrote: Instead of that if it allowed an extensible compiler with the same macro defelem, I could call - [:link-to {:url http://google.com} Hi this is google] Will that not be more clojurey :) That seems more complicated,

Re: Defining custom tags using hiccup ?

2012-05-12 Thread Walter Tetzner
On Saturday, May 12, 2012 10:36:35 PM UTC-4, James Reeves wrote: That seems more complicated, IMO. Why require an custom macro system when normal functions do the same job? What's the advantage? The same reason hiccup uses data structures to represent HTML instead of using nested functions:

Re: Defining custom tags using hiccup ?

2012-05-12 Thread Dave Sann
As I see it, link-to is a function that saves you a little bit of typing if you choose to use it. But if you don't, you could just write [:a {:href blah} Blah] where :a is exactly :link-to, just spelt differently. what is proposed above seems to be renaming of elements and attributes - but

Re: Defining custom tags using hiccup ?

2012-05-12 Thread Murtaza Husain
Thats the whole idea. The ability to build abstractions. Currently I have a host of functions that I have defined for higher level components, which then return datastructures defined in terms of basic html tags. It would be a great idea if I could directly represent even custom tags as the

clojurescript error

2012-05-12 Thread Murtaza Husain
Hi, I have an array of maps defined as below - (def input-boxes [{:name :person/first-name :label-text Full Name :help-text Please enter your full name as - First Middle Last} {:name :person/ejamaat :label-text Ejamaat Number :placeholder-text Ejamaat #} {:name