Re: leiningen - a Clojure build tool

2009-11-18 Thread ngocdaothanh
Lein is super easy to install and use! To demonstrate the ease of installation, the Installation part in README should say: 1. Download only one file: wget http://github.com/technomancy/leiningen/raw/master/bin/lein 2. chmod +x lein 3. ./lein self-install Thanks for the work. On Nov 18, 4:41 

Re: leiningen - a Clojure build tool

2009-11-18 Thread Shantanu Kumar
Is any IDE support planned for this? As it turns out, many people (including me) stick with Ant just because the IDE support is fantastic. Regards, Shantanu On Nov 18, 12:29 pm, Phil Hagelberg p...@hagelb.org wrote: I'm pleased to announce the initial release of Leiningen. Leiningen is a

Re: leiningen - a Clojure build tool

2009-11-18 Thread ngocdaothanh
Which IDE and Ant plugin do you use? I think you can use lein pom to have an pom.xml file for use with Maven. Hope that your fantastic IDE supports Maven. On Nov 18, 5:39 pm, Shantanu Kumar kumar.shant...@gmail.com wrote: Is any IDE support planned for this? As it turns out, many people

Re: clojure.xml/parse of XHTML yields a 503 on the DTD

2009-11-18 Thread David Brown
On Tue, Nov 17, 2009 at 10:12:19AM -0800, David Brown wrote: On Tue, Nov 17, 2009 at 08:03:59AM -0800, pkw wrote: I'm having this same problem. Did you find a way around it? I want to try changing the User-Agent, but I can't figure out how to do that. I suspect that the Sax parser by default is

Re: Proposal: Extend behavior of hash-map

2009-11-18 Thread David Brown
On Tue, Nov 17, 2009 at 03:24:46PM -0800, Richard Newman wrote: Baby, bathwater. Making a persistent map out of a Java map is expensive. Not everything that implements Map is concrete; e.g., spending several seconds making a local persistent Clojure map out of a distributed hash table proxy, just

Re: leiningen - a Clojure build tool

2009-11-18 Thread Shantanu Kumar
On Nov 18, 1:45 pm, ngocdaothanh ngocdaoth...@gmail.com wrote: Which IDE and Ant plugin do you use? I think you can use lein pom to have an pom.xml file for use with Maven. Hope that your fantastic IDE supports Maven. Earlier I used NetBeans but now I generally use Eclipse -- both of them

Re: A typo on the website about vars

2009-11-18 Thread Michael Wood
2009/11/17 Chouser chou...@gmail.com: On Tue, Nov 17, 2009 at 8:40 AM, Jacek Laskowski ja...@laskowski.net.pl wrote: I'm wondering what part is missing in which provides a means for nested contexts to communicate with code before it the call stack. at http://clojure.org/vars? I think the

Re: A Clojure Highlife

2009-11-18 Thread Joseph Smith
The m-surrounding-neighbors-seq function only memoizes sequences containing Refs surrounding a particular ref at (x,y). I do this to avoid the recalculation of the coordinates of the cells surrounding each cell. As I understand it, memoization caches return values for input values. For

Stack overflow while processing XML

2009-11-18 Thread mkrajnak
I am processing a very large xml file, 13MB, using clojure.xml.parse and clojure.contrib.zip-filter.xml with clojure 1.0.0. The xml file contains information on 13000 japanese characters and I'm extracting about 200 or so. At its core it extracts a very small subset of elements using: (xml-

Re: Stack overflow while processing XML

2009-11-18 Thread Alex Osborne
mkrajnak wrote: I am processing a very large xml file, 13MB, using clojure.xml.parse and clojure.contrib.zip-filter.xml with clojure 1.0.0. clojure.xml.parse loads the whole document into memory at once so it's only really suitable for small (at most a megabyte or two) XML documents. Have a

Transforming a SeqMap to a Map

2009-11-18 Thread Robert Campbell
Hey guys, I'm having some trouble finding a nice way to perform a map transformation I need. I need to transform this: [ {:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6} {:a 7 :b 8 :c 9} ] into this: { {:a 1 :b 2} 3 {:a 4 :b 5} 6 {:a 7 :b 8} 9 } I wanted to use map, but each f in map only returns one value,

Re: Transforming a SeqMap to a Map

2009-11-18 Thread Christophe Grand
Hi (defn f [coll] (into {} (for [{c :c :as m} coll] [(dissoc m :c) c]))) or (defn f [coll] (reduce (fn [r {c :c :as m}] (assoc r (dissoc m :c) c)) {} coll)) hth, Christophe On Wed, Nov 18, 2009 at 2:19 PM, Robert Campbell rrc...@gmail.com wrote: Hey guys, I'm having some trouble

Re: A Clojure Highlife

2009-11-18 Thread Jeff Heon
Thanks. I got it working with the bundle. Arghh, I realized about half an hour after posting that I had misunderstood m-surrounding-neighbors-seq. I withdrew my post from the Google group, but like they say, nothing vanishes without a trace ;) I had not realized that since the grid is made out

Re: Transforming a SeqMap to a Map

2009-11-18 Thread Rich Hickey
On Wed, Nov 18, 2009 at 8:19 AM, Robert Campbell rrc...@gmail.com wrote: Hey guys, I'm having some trouble finding a nice way to perform a map transformation I need. I need to transform this: [ {:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6} {:a 7 :b 8 :c 9} ] into this: { {:a 1 :b 2} 3 {:a 4 :b 5} 6

Re: Transforming a SeqMap to a Map

2009-11-18 Thread Meikel Brandmeyer
Hi, On Nov 18, 2:35 pm, Christophe Grand christo...@cgrand.net wrote: (defn f [coll]   (into {} (for [{c :c :as m} coll] [(dissoc m :c) c]))) (defn f [coll] (into {} (for [{c :c :as (- (dissoc :c) m)} coll] [m c]))) Untested. Sincerely Meikel -- You received this message because you

Re: leiningen - a Clojure build tool

2009-11-18 Thread Sean Devlin
I'm pleased to announce the initial release of Leiningen. Leiningen is a build tool for Clojure designed to not set your hair on fire. Phil - Will there be a backwards compatibility mode for those of us that like setting our hair on fire? Perhaps a *set-hair-on-fire* binding that defaults to

Re: Transforming a SeqMap to a Map

2009-11-18 Thread Sean Devlin
user=(def your-data [{:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6} {:a 7 :b 8 :c 9}]) user=(into {} (map (juxt #(dissoc % :c) :c) your-data)) {{:a 1, :b 2} 3, {:a 4, :b 5} 6, {:a 7, :b 8} 9} On Nov 18, 8:36 am, Rich Hickey richhic...@gmail.com wrote: On Wed, Nov 18, 2009 at 8:19 AM, Robert Campbell

Re: Proposal: Extend behavior of hash-map

2009-11-18 Thread Sean Devlin
Do you mean the bean fn? http://clojure.org/api#toc120 On Nov 18, 4:23 am, David Brown cloj...@davidb.org wrote: On Tue, Nov 17, 2009 at 03:24:46PM -0800, Richard Newman wrote: Baby, bathwater. Making a persistent map out of a Java map is expensive. Not everything that implements Map is

Re: leiningen - a Clojure build tool

2009-11-18 Thread Teemu Antti-Poika
On Nov 18, 4:00 pm, Sean Devlin francoisdev...@gmail.com wrote: Will there be a backwards compatibility mode for those of us that like setting our hair on fire?  Perhaps a *set-hair-on-fire* binding that defaults to false? You could always write a maven plugin for leiningen. That ought to do

Re: leiningen - a Clojure build tool

2009-11-18 Thread Stuart Sierra
On Nov 18, 9:00 am, Sean Devlin francoisdev...@gmail.com wrote: (binding [*set-hair-on-fire* true]   ;do-stuff) I like this just for the Var name. -SS -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: A Clojure Highlife

2009-11-18 Thread Joseph Smith
Heh. I had wondered if you had withdrawn the post since I only saw it in my email box. No worries- I went back and examined my code to make sure it was doing what I thought it was. --- Joseph Smith j...@uwcreations.com (402)601-5443 On Nov 18, 2009, at 7:35 AM, Jeff Heon jfh...@gmail.com

Re: swap two elements in an arbitrary collection

2009-11-18 Thread Jacek Laskowski
On Sat, Nov 14, 2009 at 11:59 PM, Meikel Brandmeyer m...@kotka.de wrote: And there is always macroexpand(-1)... user= (macroexpand-1 '(- foo (bar baz))) (bar foo baz) I'm glad you've pointed it out as I've recently been asking myself how to expand a macro entirely (including subforms)? I'd

Re: Clojure Terracotta - TIM

2009-11-18 Thread Paul Stadig
Thanks for your feedback. I was able to get it to work again and pushed some minor changes to the git repo. I downloaded Terracotta 3.1.1, and followed the instructions in the tim-clojure-1.0-SNAPSHOT/example/README. I ended up uncommenting all of the code in ClojureTerracottaConfigurator.java. I

Missing unsigned-bit-shift-right?

2009-11-18 Thread MarkSwanson
I'm porting some Java code that uses . Is there a way to do this in Clojure? FYI: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/opsummary.html -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
I have the same problem. I run ant clean and then ant - Dclojure.jar=/path/to/clojure-1.0.0.jar. The errors I get (long stack traces omitted but available if requested): [java] java.io.FileNotFoundException: Could not locate clojure/ stacktrace__init.class or clojure/stacktrace.clj on

Re: Datatypes and Protocols - early experience program

2009-11-18 Thread samppi
This is wonderful, wonderful, wonderful. It makes my work with FnParse so much easier. Question: are the general mechanisms for accessing and setting fields their keywords and assoc respectively: (deftype Bar [a b c d e]) (def b (Bar 1 2 3 4 5)) (:c b) (def c (assoc b :e 2)) Does (:c b)

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread Stuart Halloway
The file jmx.clj should not exist on the 1.0-compatible branch. Is it there on yours? Stu I have the same problem. I run ant clean and then ant - Dclojure.jar=/path/to/clojure-1.0.0.jar. The errors I get (long stack traces omitted but available if requested): [java]

take repeatedly alternative?

2009-11-18 Thread Raoul Duke
when people use (take n (repeatedly fn)) are there other ways they might have written that in clojure? it just seems like more ascii than should be required :-) e.g. not exactly the same but bigloo has list-tabulate http://www-sop.inria.fr/mimosa/fp/Bigloo/doc/bigloo-7.html#list-tabulate

Re: JScheme

2009-11-18 Thread patrickdlogan
There are other lisps (including schemes) but the three I have some experience with are JScheme, SISC, and Clojure. Based on that I would answer it this way... * Use SISC if you want a full implementation of Scheme on the JVM. (It's been reliable in the past but I have not used it for a couple of

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
I downloaded the 1.0-compatible branch of clojure-contrib this afternoon, and jmx.clj was included. Unfortunately, there are other build problems as well. dataflow.clj is unable to find walk.clj, which is in the test_contrib directory. In addition, error_kit.clj references stacktrace.clj, which

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
I went to http://github.com/richhickey/clojure-contrib/ and clicked the Download button. Was that the wrong thing to do? Bill -- 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

Re: A macro for flexible keyword argument handling

2009-11-18 Thread Constantine Vetoshev
On Nov 17, 11:33 pm, nchubrich nicholas.chubr...@gmail.com wrote: can it be any more general or minimal than this? Seems to me that your suggestion effectively makes every positional argument optional. You did note that the scheme calls for supplied- predicates, but this pushes responsibility

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
Correction: I went to http://github.com/richhickey/clojure-contrib/tree/clojure-1.0-compatible and clicked the download button. On Nov 18, 8:14 pm, .Bill Smith william.m.sm...@gmail.com wrote: I went tohttp://github.com/richhickey/clojure-contrib/and clicked the Download button.  Was that the

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread Mike Hinchey
The github link for download is confusing. It points to the most recent download irrespective of branch. This should be correct: http://github.com/richhickey/clojure-contrib/archives/clojure-1.0-compatible -Mike On Wed, Nov 18, 2009 at 6:27 PM, .Bill Smith william.m.sm...@gmail.comwrote:

Code improvement: incrementing a meta val

2009-11-18 Thread samppi
Is there a more elegant way to phrase this? (defn- inc-index Increments the :index val in the givens state's metadata. [state] (vary-meta state assoc :index (inc (:index ^state -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread Mike Hinchey
github has a ticket, so they should fix the link soon. On Wed, Nov 18, 2009 at 6:58 PM, Mike Hinchey hinche...@gmail.com wrote: The github link for download is confusing. It points to the most recent download irrespective of branch. -- You received this message because you are subscribed

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
Thank you, Mike. I will give that a try. -- 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

Re: Code improvement: incrementing a meta val

2009-11-18 Thread jan
samppi rbysam...@gmail.com writes: Is there a more elegant way to phrase this? (defn- inc-index Increments the :index val in the givens state's metadata. [state] (vary-meta state assoc :index (inc (:index ^state This is slightly cleaner (defn- inc-index Increments the :index

Re: leiningen - a Clojure build tool

2009-11-18 Thread Phil Hagelberg
ngocdaothanh ngocdaoth...@gmail.com writes: Lein is super easy to install and use! To demonstrate the ease of installation, the Installation part in README should say: 1. Download only one file: wget http://github.com/technomancy/leiningen/raw/master/bin/lein 2. chmod +x lein 3. ./lein

Re: leiningen - a Clojure build tool

2009-11-18 Thread Phil Hagelberg
Shantanu Kumar kumar.shant...@gmail.com writes: Is any IDE support planned for this? As it turns out, many people (including me) stick with Ant just because the IDE support is fantastic. I have no plans myself, but if writing the pom is not sufficient a plugin could be written. I've never

Re: SLIME REPL broken

2009-11-18 Thread Kei Suzuki
You can still use slime-fancy and the arglist display feature by just disabling autodoc mode like this: (setq slime-use-autodoc-mode nil) (slime-setup '(slime-fancy)) On Nov 18, 11:26 am, Constantine Vetoshev gepar...@gmail.com wrote: On Nov 17, 2:52 pm, David Nolen dnolen.li...@gmail.com

LDAP lib

2009-11-18 Thread Sean Devlin
Hello everyone. I need to query an LDAP directory. Is there an existing Clojure library already? Simply trying to avoid reinventing the wheel. Sean -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: leiningen - a Clojure build tool

2009-11-18 Thread Shantanu Kumar
On Nov 19, 10:22 am, Phil Hagelberg p...@hagelb.org wrote: Shantanu Kumar kumar.shant...@gmail.com writes: Is any IDE support planned for this? As it turns out, many people (including me) stick with Ant just because the IDE support is fantastic. I have no plans myself, but if writing

Re: Missing unsigned-bit-shift-right?

2009-11-18 Thread Michael Wood
2009/11/19 MarkSwanson mark.swanson...@gmail.com: I'm porting some Java code that uses . Is there a way to do this in Clojure? FYI: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/opsummary.html I'm sure someone else will have a proper answer, but you could just create a class with

Re: leiningen - a Clojure build tool

2009-11-18 Thread Martin DeMello
On Thu, Nov 19, 2009 at 10:52 AM, Phil Hagelberg p...@hagelb.org wrote: I must confess I don't understand the avoid the command-line mindset at all, so I need a little extra explanation. It's a matter of context switching. If I'm working in an IDE, I want to compile the code without having to