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
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
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
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
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
@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
> 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 :-/
--~--~-~--~--
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
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
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.
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
>>
>>
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
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
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
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
> 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
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
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
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
> 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
> 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
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
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
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
24 matches
Mail list logo