Re: Clojure 1.0.0 has been uploaded to Maven Central - Finally

2009-07-14 Thread Mark Derricutt
It shouldn't be hard to create a clojure archetype actually, now that clojures in the main repo, if I get a compiled version of my clojure-maven-plugin in a public repository somewhere I could easily make an archetype that combines the two, with a ready to run clojure project. I think I have a new

Re: VimClojureBox

2009-07-14 Thread e
i vote for zero config, option 1. On Tue, Jul 14, 2009 at 12:25 PM, Justin Johnson wrote: > Hi, > > I've been thinking about creating something like Clojure Box for Windows > Vim users, using Meikel's wonderful VimClojure. The first question is, does > anyone think this would be worth while? > >

Re: Clojure emacs formatting of letfn

2009-07-14 Thread Mark Engelberg
On Tue, Jul 14, 2009 at 7:46 PM, Phil Hagelberg wrote: > I see. The way I usually see let-forms is having the argument list start > on the same line as the "let" itself, which would look like: > >> (defn test-letfn [n] >>   (letfn [(function1 [a b] >>                      (+ (function2 a) sqr-n))

Re: Clojure emacs formatting of letfn

2009-07-14 Thread Richard Newman
> It's unclear (to me at least) what letfn offers you over regular let, > since functions are just values anyway: let has sequential binding; letfn makes the names of each function available in all of them. This allows for mutual recursion, amongst other things. (Presumably there are some com

Re: Clojure emacs formatting of letfn

2009-07-14 Thread Richard Newman
> The bracket under the letfn is indented a couple spaces more than I'd > probably prefer, but that's not really what bothers me. The bodies of > the functions are indented WAY too much. Incidentally, VimClojure gets the second part wrong, too (though it gets the first correct). Indenting 4 a

Re: Clojure emacs formatting of letfn

2009-07-14 Thread Phil Hagelberg
Mark Engelberg writes: > This is a total nonsense function, just to show formatting (will it > even show up in googlegroups with the proper formatting?): > > (defn test-letfn [n] > (letfn > [(function1 [a b] > (+ (function2 a) sqr-n)) >(function2 [a] >

Re: Clojure emacs formatting of letfn

2009-07-14 Thread Mark Engelberg
On Tue, Jul 14, 2009 at 7:15 PM, Phil Hagelberg wrote: > I haven't used letfn; could you give an example of how it's formatted > and how you think it should be formatted? > > -Phil This is a total nonsense function, just to show formatting (will it even show up in googlegroups with the proper for

Re: Clojure emacs formatting of letfn

2009-07-14 Thread Phil Hagelberg
Mark Engelberg writes: > I'm unhappy with the way it formats the letfn special form. It > doesn't seem to know that this form is used for defining functions, so > the formatting doesn't look anything at all like a function > definition. Any suggestions on how to add more sane indenting for > t

Re: another binding issue?

2009-07-14 Thread Kevin Downey
this is how you do it: user=> (def a 0) #'user/a user=> (binding [a 1] (map #(+ % a) (range 5))) (0 1 2 3 4) user=> (binding [a 1] (let [a a] (map #(+ a %) (range 5 (1 2 3 4 5) user=> you capture the dynamic scope in the lexical scope so the closure can close over it. dunno how applicable t

Re: ANN: FnParse, a functional parsing library

2009-07-14 Thread samppi
I haven't compared it directly to any other parsing libraries, but I'd surmise that it'll be slower than more optimized libraries, especially Java ones. Currently, the optimizations that the library has is that it lazily evaluates both rules (in the conc and alt forms) and token sequences. At thi

Re: another binding issue?

2009-07-14 Thread Mark Engelberg
It almost seems like what you want is for lazy data structures to close over the dynamic vars that have been modified from their root bindings at the time the lazy data structure is created. Seems like coming up with well-defined semantics for this would be an interesting research problem, and if

Re: VimClojureBox

2009-07-14 Thread Justin Johnson
> > For your options: maybe number 2? > > That would allow, that a Windows Installer, a Mac Installer > and some unix thing, could be put into the same project > (VimClojure itself?). That would take away a lot of required > syncronisation: Vim upstream, VC upstream, ... > > What do you think? > T

Accessing dynamic and lexical bindings

2009-07-14 Thread Tim Snyder
I'm trying to determine if there is a way to gain access to the dynamic and lexical bindings tables at both run-time and compile- time. In general this seems like a bad idea, but I'd like to be able to modify the evaluation environment while performing compile-time partial evaluation. Last night

Clojure Workshop in London next Monday

2009-07-14 Thread Alex Scordellis
Next Monday evening we're hosting a Clojure Workshop at the ThoughtWorks offices in central London. This will be an introductory workshop where I hope that we'll all start to learn Clojure together. I'll present a quick introduction to what's interesting and different about Clojure, then we'll ru

Re: clojure.test - Test fixtures and ordering

2009-07-14 Thread Stuart Sierra
On Jul 14, 1:23 pm, Jarkko Oranen wrote: > Perhaps it > would be best to consider test-ns-hook a low-level construct that can > do whatever it wants with the defined tests and fixtures, and provide > some other means for specifying which tests will be run. Yes, I'm leaning this way too. If you

Re: binding issue

2009-07-14 Thread Meikel Brandmeyer
Hi, Am 14.07.2009 um 21:01 schrieb bgray: Ok, so *if* this is intended behavior, what have people been doing to bind variables dependant on other bindings? I can't be the first to run into this. I haven't run into this, but there are two obvious approaches: (let [new-a (compute n e w a)]

Re: binding issue

2009-07-14 Thread Stuart Sierra
On Jul 14, 3:01 pm, bgray wrote: > Ok, so *if* this is intended behavior, what have people been doing to > bind variables dependant on other bindings?  I can't be the first to > run into this. Just nest multiple binding forms: (binding [a ...] (binding [b ...] ...)) Not pretty, but it do

Re: easiest JMX API ever, in Clojure...

2009-07-14 Thread Michael Wood
2009/7/14 Stuart Halloway : > > ...wants your   help to be born! :-) > > There is a branch in clojure-contrib that includes work so far: > http://github.com/richhickey/clojure-contrib/tree/jmx > . I want feedback on ease of use, most important features to add next, > code quality, you name it. >

Re: another binding issue?

2009-07-14 Thread Kevin Downey
closures capture lexical scope, binding creates dynamic scope. lexical scope is where a closure is defined, dynamic is when it is called. because filter is lazy, the closure is called outside the dynamic scope created by binding On Jul 14, 1:07 pm, Aaron Cohen wrote: > I'm a little unclear on w

Re: another binding issue?

2009-07-14 Thread Aaron Cohen
I'm a little unclear on why this happens still. #(= % a) is a closure, correct? My understanding is that this should capture the environment when it is defined. Why does "the environment" not include the current bindings? -- Aaron On Tue, Jul 14, 2009 at 4:03 PM, Mark Engelberg wrote: > > On

Re: another binding issue?

2009-07-14 Thread Mark Engelberg
On Tue, Jul 14, 2009 at 12:40 PM, Jarkko Oranen wrote: > This is a common gotcha. It's actually a laziness issue: the seq > produced by filter is realised only after it exits the binding scope, > thus producing '(1). You need to use "doall" to force the seq if you > want the binding to apply. Yea

Re: another binding issue?

2009-07-14 Thread bgray
That makes sense. Thanks for the quick help! On Jul 14, 2:40 pm, Chouser wrote: > On Tue, Jul 14, 2009 at 3:04 PM, bgray wrote: > > > I'm not sure if this is a binding issue or not. > > > user=> (def a 1) > > #'user/a > > user=> (binding [a 3] (filter #(= % a) '(1 2 3))) > > (1) > > user=> > >

Re: another binding issue?

2009-07-14 Thread Jarkko Oranen
On Jul 14, 10:04 pm, bgray wrote: > I'm not sure if this is a binding issue or not. > > user=> (def a 1) > #'user/a > user=> (binding [a 3] (filter #(= % a) '(1 2 3))) > (1) > user=> > > In this case, I was expecting a list with 3 in it. This is a common gotcha. It's actually a laziness issue: t

Re: another binding issue?

2009-07-14 Thread Chouser
On Tue, Jul 14, 2009 at 3:04 PM, bgray wrote: > > I'm not sure if this is a binding issue or not. > > user=> (def a 1) > #'user/a > user=> (binding [a 3] (filter #(= % a) '(1 2 3))) > (1) > user=> > > In this case, I was expecting a list with 3 in it. filter is lazy, and your lazy seq is "leaking

another binding issue?

2009-07-14 Thread bgray
I'm not sure if this is a binding issue or not. user=> (def a 1) #'user/a user=> (binding [a 3] (filter #(= % a) '(1 2 3))) (1) user=> In this case, I was expecting a list with 3 in it. Thanks, Brandon --~--~-~--~~~---~--~~ You received this message because you a

Re: easiest JMX API ever, in Clojure...

2009-07-14 Thread Howard Lewis Ship
Looks very nice; what are you planning to use JMX for? On Tue, Jul 14, 2009 at 11:23 AM, Stuart Halloway wrote: > > ...wants your   help to be born! :-) > > There is a branch in clojure-contrib that includes work so far: > http://github.com/richhickey/clojure-contrib/tree/jmx > . I want feedback

Re: binding issue

2009-07-14 Thread bgray
Ok, so *if* this is intended behavior, what have people been doing to bind variables dependant on other bindings? I can't be the first to run into this. Thanks! Brandon On Jul 12, 12:05 am, Tom Faulhaber wrote: > Looking at the clojure docs, it doesn't appear to be defined whether > binding is

easiest JMX API ever, in Clojure...

2009-07-14 Thread Stuart Halloway
...wants your help to be born! :-) There is a branch in clojure-contrib that includes work so far: http://github.com/richhickey/clojure-contrib/tree/jmx . I want feedback on ease of use, most important features to add next, code quality, you name it. Here's a teaser: -

Re: ANN: FnParse, a functional parsing library

2009-07-14 Thread ronen
Looks quite nice, can you tell how it compares (performance wise) to other parsing libraries? On Jul 6, 3:55 am, Wilson MacGyver wrote: > Thanks for the tip on looking at clojure.contrib. I keep forgetting to   > check there. > > On Jul 5, 2009, at 4:20 PM, samppi wrote: > > > > > If you need a

Re: surprising behaviour with do, ns and def

2009-07-14 Thread Chris Kent
Hi Stuart Thanks for the explanation, that makes sense and I very much doubt I'd have figured that out by myself without a lot of head scratching. And you were right about the intern function, that does exactly what I was looking for. Cheers Chris On Jul 14, 3:04 am, Stuart Sierra wrote: > On

Clojure emacs formatting of letfn

2009-07-14 Thread Mark Engelberg
I'm using Clojure Box on Windows, corresponding to version 1.0. I'm unhappy with the way it formats the letfn special form. It doesn't seem to know that this form is used for defining functions, so the formatting doesn't look anything at all like a function definition. Any suggestions on how to

Re: Clojure Session Questions

2009-07-14 Thread Rich Hickey
On Jul 14, 12:24 pm, Howard Lewis Ship wrote: > Seems like every time I do a Clojure talk I get questions I can't > answer. I did an informal session last night for Portland's > Functional Programming Study Group. > > Two questions came up: > > First, a Haskell coder made the broad claim that

Re: clojure.test - Test fixtures and ordering

2009-07-14 Thread Jarkko Oranen
On Jul 14, 6:58 pm, Stuart Sierra wrote: > Namespace-wide fixtures ("once-fixtures") are easy -- they should just > run around the top-level test function.  That's something I can fix, > and it will be sufficient for your example. > > But per-test fixtures ("each-fixtures") present a problem.  If

Re: VimClojureBox

2009-07-14 Thread Meikel Brandmeyer
Hi Justin, Am 14.07.2009 um 18:25 schrieb Justin Johnson: Does anyone have any thoughts on this? Any suggestions? A request for such a "VimClojureBox" came up several times. In fact I set up a "ClojureBall" on bitbucket, but never came far. For your options: maybe number 2? That would allo

Re: Clojure 1.0.0 has been uploaded to Maven Central - Finally

2009-07-14 Thread AlamedaMike
Jason, Daniel, Thanks for the input. Most helpful. I used the POM at http://github.com/dysinger/clojure-pom/tree/master and was able to build and test clojure and clojure-contrib from the sources there. He also has some good documentation. Recommended. I was hoping not to have to dig to deeply

VimClojureBox

2009-07-14 Thread Justin Johnson
Hi, I've been thinking about creating something like Clojure Box for Windows Vim users, using Meikel's wonderful VimClojure. The first question is, does anyone think this would be worth while? Assuming the answer is yes... I'm trying to decide if it makes sense to pack everything into a single

Clojure Session Questions

2009-07-14 Thread Howard Lewis Ship
Seems like every time I do a Clojure talk I get questions I can't answer. I did an informal session last night for Portland's Functional Programming Study Group. Two questions came up: First, a Haskell coder made the broad claim that other attempts at STM did not use MVCC because it was "too sl

Re: Clojure 1.0.0 has been uploaded to Maven Central - Finally

2009-07-14 Thread Daniel E. Renfer
On Tue, 2009-07-14 at 06:58 -0700, AlamedaMike wrote: > Stefan, Meikel, > > Thanks much for this. It looks very interesting. > > Forgive a newb question but I just downloaded Maven for the first time > 30 minutes ago. I read the "Maven in 5 minutes" doc, and executed: > > mvn archetype:create

Re: clojure.test - Test fixtures and ordering

2009-07-14 Thread Stuart Sierra
On Jul 14, 9:41 am, Matt Revelle wrote: > I recently noticed that fixtures were not being called for some tests   > in my code and it turns out (thanks, Chouser) the use of test-ns-hook   > is incompatible with fixtures.  This isn't necessarily undesirable   > behavior, but it raises an issue: do

Re: Clojure 1.0.0 has been uploaded to Maven Central - Finally

2009-07-14 Thread Jason Sankey
Hi there, AlamedaMike wrote: > Stefan, Meikel, > > Thanks much for this. It looks very interesting. > > Forgive a newb question but I just downloaded Maven for the first time > 30 minutes ago. I read the "Maven in 5 minutes" doc, and executed: > > mvn archetype:create -DgroupId=org.clojure -D

Re: Can anyone help getting Enclojure to work?

2009-07-14 Thread AlamedaMike
Bruce, There is a Google group for Enclojure at: http://groups.google.com/group/enclojure/ You might try there, as they have discussed similar issues recently. On Jul 13, 6:49 pm, bruceq wrote: > I am having problems getting Enclojure to work properly on Netbeans > 6.7 and also trying 6.5 >

Re: Clojure 1.0.0 has been uploaded to Maven Central - Finally

2009-07-14 Thread AlamedaMike
Stefan, Meikel, Thanks much for this. It looks very interesting. Forgive a newb question but I just downloaded Maven for the first time 30 minutes ago. I read the "Maven in 5 minutes" doc, and executed: mvn archetype:create -DgroupId=org.clojure -DartifactId=clojure followed by: mvn package

clojure.test - Test fixtures and ordering

2009-07-14 Thread Matt Revelle
Hi group, I recently noticed that fixtures were not being called for some tests in my code and it turns out (thanks, Chouser) the use of test-ns-hook is incompatible with fixtures. This isn't necessarily undesirable behavior, but it raises an issue: does anyone want high-level support fo

Re: Problem with running clojure on java.

2009-07-14 Thread mmwaikar
Arghhh...this was causing me a lot of pain. Thanks for the reply. On Jul 13, 11:54 pm, Richard Newman wrote: > Manoj, > > require is for Clojure libraries only. > > You probably want import: > > http://clojure.org/api#toc297 > > but note that you don't need to *load* Java libraries per se, so lo

Re: Why do Enlive template functions return a seq instead of a str?

2009-07-14 Thread Christophe Grand
On Mon, Jul 13, 2009 at 11:26 AM, Robert Campbell wrote: > > I need the _exact_ functionality of the "sniptest" function (which > appears to have been removed) in production code. sniptest lives now in http://github.com/cgrand/enlive/blob/master/test/net/cgrand/enlive_html/test.clj I may have b

Re: Clojure 1.0.0 has been uploaded to Maven Central - Finally

2009-07-14 Thread Meikel Brandmeyer
Hi, Am 13.07.2009 um 19:12 schrieb Stefan Hübner: just a quick update on the Maven bundle: it has finally been uploaded and is available for your Maven based projects as org.clojure:clojure:1.0.0:jar (groupId, artifactId, version, type). This means that it is also avalaible for Ivy users. So

Re: Why this macro fails??

2009-07-14 Thread Michael Wood
2009/7/14 Stephen C. Gilardi : > > On Jul 13, 2009, at 10:26 PM, sailormoo...@gmail.com wrote: > >> user=> (try (Integer/parseInt "x") (catch Exception _ 0)) >> 0 >> user=> (defmacro parse-int [a default] `(try (Integer/parseInt ~a) >> (catch Except >> ion _ ~default))) >> #'user/parse-int >> user

Re: Confusion on Clojure 1.0, compatible clojure-contrib, git-hub, svn, ...

2009-07-14 Thread Michael Wood
2009/7/13 Cosmin Stejerean : > On Mon, Jul 6, 2009 at 2:59 PM, Laurent PETIT > wrote: >> >> I think there could be a way to make both parts happy : rather than >> just adding the info that it is an old repo in some README file in the >> root directory of the svn repo, committing also an svn delet