I would like to pull together functions that help with Java interop
and place them in a new contrib: java-utils. Some examples:
(1) Pull out SteveG's properties fn, currently hidden in the internals
of clojure.contrib.sql
(2) reflective helpers for accessing private and protected values
(3) coercions for Java's irritating types: File/String, URL/String,
IPAddress/String, etc.
(4) Maybe some of the utils currently hiding in Compojure (James,
would that be cool with you? Have you signed/would you sign the
contributor agreement?)
If this is interesting to others (or at least inoffensive) I will move
forward with it.
Are there other little nuggets of Java-interop code that I should also
consider?
Cheers,
Stu
> If this is interesting to others (or at least inoffensive) I will move
> forward with it.
I'm in favor.
I'd also like to get your latest thinking on your suggestions from
some time ago about clojure.contrib.lazy-seqs. If they can be
rewritten as you suggested as functions that return a new sequence
rather than as "def'd" sequences, that's strictly more powerful and
would be an improvement. (One can always use a def'd var to hold such
a function if that's desired in a particular application.)
--Steve
I like it. Sounds like a "Clojure for people who don't know Java APIs"
layer. I'm in that group for the most part.
I do acknowledge and see the value in arguments against doing excessive
wrapping of Java-land, but at the same time, the Java libraries seem
quite baroque at times and can be difficult to understand for people who
haven't been steeped in Java idioms. Sometimes I find myself thinking,
"what on earth do I need to make all these objects for!?" (*cough* NIO
*cough*). But I must remind myself that perhaps such architectures solve
problems that I haven't had to deal with coming from other languages.
It's a tough issue.
> Are there other little nuggets of Java-interop code that I should
> also consider?
>
I would love to see a non-blocking IO API that isn't psychotic. My brain
starts to liquify when I read the NIO API documentation, and from what I
can tell, even seasoned Java folks find it a bit much :)
-Kyle
Steve,
At quick glance it looks to me that all three of the lazy-seqs should
be functions. If you want me to I'll change this and add tests.
Stuart
> At quick glance it looks to me that all three of the lazy-seqs should
> be functions. If you want me to I'll change this and add tests.
Please do. Thanks.
--Steve
Stuart