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).
>
>
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
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
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
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
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
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
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
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)
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
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:
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
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
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
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
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
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
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
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
--~--~-~--~~~--
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
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
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
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
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
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
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
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
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 !:))),
> 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
> 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
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
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
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)))
--~--~-~--~~~---~--~---
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
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
>> 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
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
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
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)
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
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
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
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
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
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
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
46 matches
Mail list logo