Re: DISCUSS: clojure.contrib.java-utils/as-str

2009-04-08 Thread Eric Tschetter
Might I suggest (defn as-str ([] "") ([& args] (apply str (map #(if (instance? clojure.lang.Named %) (name %) %) args))) --Eric Tschetter On Wed, Apr 8, 2009 at 8:19 PM, Stephen C. Gilardi wrote: > > On Apr 8, 2009, at 8:13 PM, Stuart Halloway wrote: > >> Changed to as-str (r654). > >

Re: clojure.contrib.lazy-xml/parse-trim forces parsing whole input

2009-04-08 Thread Jouni K . Seppänen
On Apr 9, 7:01 am, Chouser wrote: > Thanks for the report.  I've checked in a change (rev 656) that I > think will solve the problem.  Let me know if it isn't sufficient. It seems to work fine; thanks! Jouni --~--~-~--~~~---~--~~ You received this message because

Re: clojure.contrib.lazy-xml/parse-trim forces parsing whole input

2009-04-08 Thread Chouser
On Wed, Apr 8, 2009 at 4:07 PM, Jouni K. Seppänen wrote: > > A friend of mine had a problem parsing a large XML file using lazy-xml/ > parse-trim, because it caused all of the input to be parsed at once: > > http://paste.lisp.org/display/78235 > > It seems to me that the problem is fixed by apply

Re: DISCUSS: clojure.contrib.java-utils/as-str

2009-04-08 Thread Stephen C. Gilardi
On Apr 8, 2009, at 8:13 PM, Stuart Halloway wrote: Changed to as-str (r654). Very nice! Should we extend as-str to any number of arguments like its close cousin str? Here's a proposed implementation: (defn as-str "With no args, returns the empty string. With one arg, returns its nam

Clojure from JRuby (updated)

2009-04-08 Thread Jonathan Tran
I recently had a Rails project I was working on in JRuby. I also had a separate yet related project in Clojure. I thought it would be great to hook them together to provide a web interface for the Clojure project. I did some searching and found this code to evaluate Clojure code from JRuby: ht

Re: clojure dependency management and build

2009-04-08 Thread Phil Hagelberg
Stuart Halloway writes: > Lancet is more at proof-of-concept stage than ready for heavy lifting > -- I am using a mix of Ant and Rake on my own Clojure stuff. :-) > > I am happy to contribute to solving some of these issues but don't > have time to lead the effort. I'm also quite willing to

Re: How to flatten a coll only 1 level deep?

2009-04-08 Thread Chouser
On Wed, Apr 8, 2009 at 10:10 PM, Paul Drummond wrote: > > I am looking for something similar to flatten (in contrib.seq-utils) > but the function will only flatten one level deep: > > [ 1 2 3 [4 5 [6 7] ] ] ---> [ 1 2 3 4 5 [6 7] ] > > I have tried combining functions in the seq library and I've

How to flatten a coll only 1 level deep?

2009-04-08 Thread Paul Drummond
I am looking for something similar to flatten (in contrib.seq-utils) but the function will only flatten one level deep: [ 1 2 3 [4 5 [6 7] ] ] ---> [ 1 2 3 4 5 [6 7] ] I have tried combining functions in the seq library and I've studied the code for flatten and tree-seq to look for hints but so

set-system-properties

2009-04-08 Thread Stuart Sierra
Hi Stuart H! Comment on: (defn set-system-properties [settings] "Set some system properties. Nil clears a property." (doseq [[name val] settings] (if val (System/setProperty (as-str name) val) (System/clearProperty (as-str name) What if that were: (if (nil? val)

Re: clojure dependency management and build

2009-04-08 Thread Stuart Halloway
Lancet is more at proof-of-concept stage than ready for heavy lifting -- I am using a mix of Ant and Rake on my own Clojure stuff. :-) I am happy to contribute to solving some of these issues but don't have time to lead the effort. Stuart > When you are building something real with Clojure

Re: DISCUSS: clojure.contrib.java-utils/the-str

2009-04-08 Thread Stuart Sierra
By the way, I'm glad you added this. I frequently write (defn- string [x] (if (keyword? x) (name x) (str x))) at the top of a file, but I've never settled on a name. I've called it string, keystr, name-str, and half a dozen others. -other Stuart On Apr 8, 8:13 pm, Stuart Halloway wrote:

clojure.contrib.lazy-xml/parse-trim forces parsing whole input

2009-04-08 Thread Jouni K . Seppänen
A friend of mine had a problem parsing a large XML file using lazy-xml/ parse-trim, because it caused all of the input to be parsed at once: http://paste.lisp.org/display/78235 It seems to me that the problem is fixed by applying a small patch (uploaded as lazy-xml.patch), wrapping the calls to

clojure dependency management and build

2009-04-08 Thread Bradford Cross
When you are building something real with Clojure and Emacs/Slime/Swank - things can get a bit hairy with dependency management. I have scoured the inter-tubes in the past couple days to see what I could find. I found Lancet, for builds: http://github.com/stuarthalloway/lancet/tree/master I hav

Re: Java 6 dependency in clojure-contrib ok?

2009-04-08 Thread Rich Hickey
On Apr 8, 7:52 pm, Stuart Halloway wrote: > Perry's proposed props functions > (http://groups.google.com/group/clojure/browse_thread/thread/c8ec751b8... > ) uses some Java 6 methods. > > Is it ok for me to add such things to contrib, or are we maintaining > Java 5 compatibility? I'd prefer we

Re: Java 6 dependency in clojure-contrib ok?

2009-04-08 Thread Howard Lewis Ship
Looks like we need a macro: (for-jvm 1.5 () 1.6 ()) What's the emoticon for 1/2 sarcastic, 1/2 happy? On Wed, Apr 8, 2009 at 4:52 PM, Stuart Halloway wrote: > > Perry's proposed props functions > (http://groups.google.com/group/clojure/browse_thread/thread/c8ec751b8e66b0

Re: DISCUSS: clojure.contrib.java-utils/the-str

2009-04-08 Thread Stuart Halloway
Changed to as-str (r654). Stu > > In Compojure, I called this str*, but I think I like as-str a little > better. > > - James > > On Apr 5, 5:19 pm, Stuart Halloway wrote: >> Never worry about the distinction between symbols, keywords, and >> strings when working with Java APIs that know only st

Re: Enlive questions

2009-04-08 Thread Christophe Grand
Hi Tom, I'm sorry for this misfeature and, rejoice, it's gone from the ongoing redesign, there's now an explicit 'content function. The tildes are gone too! Christophe Tom Hickey a écrit : > Hi Christophe, > > I keep running into the same problem with elements getting replaced. > I'm trying t

Re: Java 6 dependency in clojure-contrib ok?

2009-04-08 Thread Victor Rodriguez
On Wed, Apr 8, 2009 at 7:52 PM, Stuart Halloway wrote: > > Perry's proposed props functions > (http://groups.google.com/group/clojure/browse_thread/thread/c8ec751b8e66b019/d56ed1200aa95bca > ) uses some Java 6 methods. > > Is it ok for me to add such things to contrib, or are we maintaining > Ja

Java 6 dependency in clojure-contrib ok?

2009-04-08 Thread Stuart Halloway
Perry's proposed props functions (http://groups.google.com/group/clojure/browse_thread/thread/c8ec751b8e66b019/d56ed1200aa95bca ) uses some Java 6 methods. Is it ok for me to add such things to contrib, or are we maintaining Java 5 compatibility? Stu --~--~-~--~~~--

Re: reading properties file: does this helper already exist?

2009-04-08 Thread Stuart Halloway
Perry, Cool -- I will add this pending the result of the Java 6 thread I am about to launch. Stu > > Hi Stuart, > > Not sure if you saw my post at http://bit.ly/sRnfG (links to list), or > the props.clj file in the Google Group. In short, it's got a > Properties reader & writer function. It t

Re: New release of the enclojure plugin is up.

2009-04-08 Thread CuppoJava
Thanks for that very informative comparison. I'll give it a try immediately. -Patrick --~--~-~--~~~---~--~~ 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 To

Re: reading properties file: does this helper already exist?

2009-04-08 Thread Perry Trolard
Hi Stuart, Not sure if you saw my post at http://bit.ly/sRnfG (links to list), or the props.clj file in the Google Group. In short, it's got a Properties reader & writer function. It tries to make Properties look like more native Clojure maps (i.e.keywords for keys), & it also uses duck-streams f

Re: Building modularised contrib with ant+ivy

2009-04-08 Thread Meikel Brandmeyer
Hi again, Am 08.04.2009 um 23:43 schrieb Meikel Brandmeyer: So I started playing with Ivy. I modified the build system of contrib to create one jar per module. The modules are organised as configurations. And by the way: you can depend on the source configuration to get the clojure source fil

Re: A large Clojure deployment

2009-04-08 Thread dysinger
We have several TB of indexes w/ literally billions of documents and will be using clojure w/ hadoop soon. I appreciate the hadoop mapr job examples in clojure. This is great stuff. On Apr 7, 6:24 am, Stuart Sierra wrote: > Hi Sean, > > It's deployed on an Ubuntu server on Amazon EC2.  Just on

Building modularised contrib with ant+ivy

2009-04-08 Thread Meikel Brandmeyer
Dear Clojurians, the recent discussions about dependency handling and a personal need led me to look at Ivy. I'm a bit annoyed to have to include a 2.5MB contrib.jar when I just want to use defvar. So I started playing with Ivy. I modified the build system of contrib to create one jar per module

Re: reading properties file: does this helper already exist?

2009-04-08 Thread Stuart Halloway
I don't like that if you treat properties as a seq you get Java Hashtable$Entry objects, instead of a vector as you would with a map, hence my "into {}". But maybe it is a silly quibble since destructuring works fine with either. Stuart >> Can't you just write: >> (.load (Properties.) (Fil

Re: Enlive questions

2009-04-08 Thread Tom Hickey
Hi Christophe, I keep running into the same problem with elements getting replaced. I'm trying to set the content of an element with raw html (from a snippet) and unable to avoid both 1) the html getting escaped and 2) the element getting replaced. I can avoid one or the other, via escaped or te

Re: A large Clojure deployment

2009-04-08 Thread Luc Prefontaine
Yep, looks like we where the first of hopefully many production implementations... It's quite funny, we are expanding the bus logic presently and without Clojure, I wonder how much effort and Java code it would have required us. We store rules in a database (hey Stuart, we really need one !:))),

Re: reading properties file: does this helper already exist?

2009-04-08 Thread Krešimir Šojat
> Can't you just write: > (.load (Properties.) (FileInputStream. f)) > and skip separate function altogehter? Err.. that should be: (doto (Properties.) (.load (FileInputStream. f))) .. point remains. -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this messa

Re: reading properties file: does this helper already exist?

2009-04-08 Thread Krešimir Šojat
>  If not   > I will add it to java-utils. > Can't you just write: (.load (Properties.) (FileInputStream. f)) and skip separate function altogehter? -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: clojure.main always exits with code 0

2009-04-08 Thread Tom Faulhaber
I'd like to second this request. It's pretty necessary to have an exit code for any type of scripting. Of course, you can always use (System/exit result-code), but a return value is "prettier" to me. On Apr 5, 5:15 pm, "John D. Hume" wrote: > Earlier today I was surprised to notice that some te

Re: A large Clojure deployment

2009-04-08 Thread Abhishek Reddy
On 4/8/09, Baishampayan Ghose wrote: > > Excuse my ignorance, but which one is the first famous Clojure app? > That could be a reference to Luc Prefontaine's veterinarian hospital application. It got some press at InfoQ: http://www.infoq.com/news/2009/01/clojure_production -- Abhishek Reddy h

reading properties file: does this helper already exist?

2009-04-08 Thread Stuart Halloway
Does something like this (or better) already exist in Clojure? If not I will add it to java-utils. Thanks, Stu (defn read-properties [f] (into {} (let [props (Properties.)] (.load props (FileInputStream. f)) props))) --~--~-~--~~~---~--~---

Re: New release of the enclojure plugin is up.

2009-04-08 Thread Luke VanderHart
Excellent... this is the first release of a Clojure IDE that hasn't immediately proven itself unusable as I put it through its paces. I expect this will become my main platform for Clojure development. Thanks! -Luke On Apr 6, 8:43 pm, Eric Thorsen wrote: > There is a new release of the Encloj

Re: New release of the enclojure plugin is up.

2009-04-08 Thread Daniel Jomphe
CuppoJava wrote: > I'm just wondering if anyone who's tried this and the IntelliJ plugin > can comment on how they compare. > > I'm wondering if Enclojure has some basic s-exp functions, like > Surround-With-(). For different reasons, I've been constantly switching between NetBeans, IntelliJ and

Re: A large Clojure deployment

2009-04-08 Thread Baishampayan Ghose
>> It's deployed on an Ubuntu server on Amazon EC2.  Just one server for >> now, but designed to scale to more.  No RDBMS! >> > > Awesome, Congratulations. I was hoping to be the 2nd "famous" Clojure > app, but it looks you beat me to it. :-) Excuse my ignorance, but which one is the first famous

Re: Will Clojure work on AppEngine?

2009-04-08 Thread Bruce Wang
On Wed, Apr 8, 2009 at 12:53 PM, Robin B wrote: > > Tonight Google officially announced JVM support for AppEngine: http://ru.ly/Z2 > JRuby on Rails is working and Clojure/Compojure works too: http://ru.ly/74 > > Unfortunately threading is restricted on GAE/J. > > Robin > just found on reddit htt

Re: Got a Clojure library?

2009-04-08 Thread Rich Hickey
Added - thanks! Rich On Apr 8, 2009, at 3:43 AM, Remco van 't Veer wrote: > > Name: clj-android > URL: http://github.com/remvee/clj-android/ > Author: Remco van 't Veer > Categories: android framework > License: MIT > Dependencies: clojure > Description: > Basic application framework for buildi

Re: Scan function

2009-04-08 Thread Laurent PETIT
Hi, I think this is similar to clojure.contrib.seq-utils/reductions ? 2009/4/8 jim > > I implemented a scan function, that is a function like reduce but that > returns a list of the intermediate results not just the last one. > > (defn scan > ([f coll] > (scan f (first coll)

Scan function

2009-04-08 Thread jim
I implemented a scan function, that is a function like reduce but that returns a list of the intermediate results not just the last one. (defn scan ([f coll] (scan f (first coll) (rest coll))) ([f val coll] (when (not (empty? coll)) (le

Re: Porting Minilight to Clojure

2009-04-08 Thread Laurent PETIT
Hello, function -main is a regular function, so the following works : " $ echo "(ns test (:gen-class)) (defn -main [] (println 1))" > test.clj $ java -cp clojure.jar clojure.main -i test.clj -e "(test/-main)" 1 " HTH, -- Laurent 2009/4/8 Mark Reid > > Hi Laurent, > > Thanks for the feedback

Re: Porting Minilight to Clojure

2009-04-08 Thread Mark Reid
Hi Laurent, Thanks for the feedback regarding namespaces. That's exactly the sort of thing I wasn't sure I was doing correctly. I currently don't use an IDE that automatically compiles files so wasn't aware of that problem. I prefer the solution that defines a main method. My only question now i

Re: Clojure on Google AppEngine

2009-04-08 Thread Paul Stadig
Nice writeup John! Thanks very much. Not sure if I made it into the first 10k developers, but I can't wait to play with this. Paul On Wed, Apr 8, 2009 at 12:52 AM, David Nolen wrote: > Very exciting, thanks for the excellent and informative writeup. > > > On Wed, Apr 8, 2009 at 12:41 AM, John

Re: Olabani says google testing Clojure for appengine

2009-04-08 Thread Korny Sietsma
Phillip Calçado (another Thoughtworker) has also done some playing with this: http://fragmental.tw/2009/04/08/clojure-on-google-app-engine/ - Korny On Wed, Apr 8, 2009 at 3:10 PM, BerlinBrown wrote: > > http://olabini.com/blog/tag/gae/ > > > > -- Kornelis Sietsma korny at my surname dot com

ANN: clj-android

2009-04-08 Thread Remco van 't Veer
It's still very basic but in light of current interest in running Clojure on Android, I've released my work on setting up a framework for Android application development into the wild. The code is available at: http://github.com/remvee/clj-android/ Beware: it's experimental and incomplete! T

Re: Got a Clojure library?

2009-04-08 Thread Remco van 't Veer
Name: clj-android URL: http://github.com/remvee/clj-android/ Author: Remco van 't Veer Categories: android framework License: MIT Dependencies: clojure Description: Basic application framework for building Android applications using Clojure. --~--~-~--~~~---~--~~ Y