Re: Too many arguments to if

2011-07-12 Thread Roman Roelofsen
Either this, or use the "when" form. http://clojuredocs.org/clojure_core/clojure.core/when 2011/7/11 Tassilo Horn : > Antonio Recio writes: > > Hi Antonio, > >> I get the error "Too many arguments to if" with this. Do you have any >> suggestion? > > `if' expects exacly one test, one then-form, an

Re: REST library

2010-02-17 Thread Roman Roelofsen
Shantanu Kumar wrote: > On Feb 17, 3:05 pm, Roman Roelofsen > wrote: > >> Hi, >> >> does someone knows a good Clojure REST framework? It should help with >> URL destructuring and maybe creating JSON return data etc. >> > > You can t

REST library

2010-02-17 Thread Roman Roelofsen
Hi, does someone knows a good Clojure REST framework? It should help with URL destructuring and maybe creating JSON return data etc. Cheers, Roman -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

Re: Removing (gensym) in macro

2010-02-08 Thread Roman Roelofsen
> It doesn't work because the scope of lname# is limited to the `(). > However lname is used in a ~@() which leaves the `() and enters the > enclosing environment (in this case the macros). There the lname# is > not valid. Ah, that makes sense, thanks! Is using (gensym) the common solution here? S

Re: Removing (gensym) in macro

2010-02-08 Thread Roman Roelofsen
> I don't see a compelling reason for such a macro. At least not in this > simple case. I agree. As I said, the purpose of this macro was purely for learning and understanding macros ;-) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Removing (gensym) in macro

2010-02-08 Thread Roman Roelofsen
Hi, just for practicing Clojure's macros I wrote the following create-java-list macro. (defmacro create-java-list [& forms] (let [prefixfn (fn [obj form] (cons (symbol ".") (cons obj form))) lname (gensym)] `(let [~lname (java.util.ArrayList.)] ~@(map (partial prefixfn lnam

ClojureQL insert data from map

2010-01-27 Thread Roman Roelofsen
Hi, when querying data in clojureql, the result is a list of maps. I often directly return this list (or a map) from my "db-logic" functions because my domain logic operates on these maps. However, I am not able to go the other way around, e.g. take the map and tell clojureql to insert/update a ta

Re: Full Disclojure - I Need Topics!

2010-01-24 Thread Roman Roelofsen
2010/1/25 Mark Engelberg : > Debugging techniques, including: > * How to make sense of Clojure's stack traces. > * How to use Java debugging and profiling tools with Clojure. +1 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: Semantic Versioning

2009-12-18 Thread Roman Roelofsen
> Talking of semantics, do you think the one I enumerated would work? > I'll certainly try to implement this concept, but I have many other > projects on the table right now, so it might take a while before I > start working on it. Yes, it looks good. The key thing is that all users/developers agr

Re: Semantic Versioning

2009-12-17 Thread Roman Roelofsen
Dealing with version numbers at build time is quite easy with tool like Maven. The important thing is that everyone agrees on the same version semantics (great summary [1]). Putting some more tooling around this should be a good idea, yes. However, the problem in Java is dealing with versions at r

Disabling ContextClassLoader

2009-12-16 Thread Roman Roelofsen
It seems that Clojure heavily uses the ContextClassLoader to load classes and compile clj files. Is there a way to disable this behaviour and tell the Clojure runtime to always use the ClassLoader where the .clj or .class file originally came from? I found some flags in the RT class but I am not s

Re: Generalizing -> & ->>

2009-12-03 Thread Roman Roelofsen
Are there any plans to add -$> to core or contrib? 2009/11/13 Laurent PETIT : > Oh yes, thanks for refreshing my memory. > And indeed it makes sense to place the question mark in the "questioned" side > :) > > 2009/11/13 Wilson MacGyver : >> Yes, it's groovy, and it's "?." It's called safe naviga

Re: 'sync' call in writeClassFile

2009-12-03 Thread Roman Roelofsen
I am a Linux user as well and this indeed sounds a bit alarming (but I haven't tested it on my machine yet, though...) Does somebody has a bit more information about the reason, current state, etc.? Thanks! 2009/11/28 David Brown : > This commit: > >     commit 5577a47a390782d7ab911c2e3c4c8be1b03

Re: Continuous Integration Server & Maven/Ivy Repo

2009-11-04 Thread Roman Roelofsen
d of "clojure- > lang", i.e. http://build.clojure.org/org/clojure/clojure/maven-metadata.xml > > That URL doesn't work. > -SS > > > On Nov 4, 10:50 am, Roman Roelofsen > wrote: >> It seems that only directory listings are disabled since >> >>

Re: Continuous Integration Server & Maven/Ivy Repo

2009-11-04 Thread Roman Roelofsen
It seems that only directory listings are disabled since http://build.clojure.org/org/clojure/clojure-lang/maven-metadata.xml is accessible. Roman 2009/11/4 Stuart Sierra : > > I don't think that URL works as a Maven/Ivy repository, because > http://build.clojure.org/org/clojure doesn't exist.

Re: Embedding Clojure in NetKernel

2009-10-29 Thread Roman Roelofsen
Do you mind sharing the links? I am interested in it as well. Thanks! Roman 2009/10/28 Tony Butterfield : > > Tom Hicks has just pointed me to an old thread which answers > questions about namespaces and isolation. Let me read and > absorb all that work first - I suspect it answers a lot of my

Re: Statics in clojure.lang.RT

2009-10-12 Thread Roman Roelofsen
2009/10/12 Christophe Grand : > On Mon, Oct 12, 2009 at 12:00 PM, Roman Roelofsen > wrote: >> >> > Plus, if you use a shared loader for most interfaces, clojure instances >> > will >> > be able to share persistent data and closures. >> >> Nop

Re: Statics in clojure.lang.RT

2009-10-12 Thread Roman Roelofsen
> Plus, if you use a shared loader for most interfaces, clojure instances will > be able to share persistent data and closures. Nope, I tried this and it didn't work. The classloader explicitly complained that e.g. Var and RT have not been loaded by the same classloader :-/ --~--~-~--~--

Re: Does OSGi make sense for Clojure?

2009-10-06 Thread Roman Roelofsen
@Mark: I doubt that this will work. Unloading a namespace would mean to remove a class from a classloader and this does not work in Java. OSGi handles this by removing the bundle's classloader completely. @All: The huge added value that OSGi still has is multi-version support. Lets say I want to

Re: Adding Classpaths On The Fly

2009-09-28 Thread Roman Roelofsen
Hi, I am currently working on a Clojure / OSGi integration: www.ogeesource.org The goal is to extend Clojure with a module-like runtime, not to fully convert Clojure and Clojure-based applications to OSGi (which would be quite hard anyway). So far you can add new modules at runtime and therefor

Re: -> with anonymous functions

2009-09-22 Thread Roman Roelofsen
Thanks for the explanation! So the solution is much simpler: user=> (-> person :childs first (select-keys [:name])) {:name "Son"} Cool :-) On Sep 22, 3:26 pm, Jarkko Oranen wrote: > On Sep 22, 3:58 pm, Roman Roelofsen > wrote: > > > > > Hi the

-> with anonymous functions

2009-09-22 Thread Roman Roelofsen
Hi there! Lets assume I have this map: user=> (def person {:name "Father" :childs [{:name "Son" :age 10}]}) Testing: user=> (-> person :childs first) {:name "Son", :age 10} Now lets filter the child map: user=> (def only-name (fn [m] (select-keys m [:name]))) user=> (-> person :childs first

Re: Questions / guidelines for adopting Clojure

2009-07-07 Thread Roman Roelofsen
Thanks a lot to everbody for the great responses! They certainly helped a lot! Cheers, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

Questions / guidelines for adopting Clojure

2009-07-07 Thread Roman Roelofsen
Hi all! I've been playing around with Clojure in the last couple of days. Very interesting! However, I have never used a non-OO, lispy, pure functional language before and several questions popped up while digging deeper into the Clojure world. I hope you don't mind if I post them together in one