> You can also do it the other way around, use gen-class
> and write yourself a static entry point callable from Java.
That's the right way to do it, IMO. Better yet, write a Java wrapper
to offer Javadocs and to hide any interop code. That means extra work
on both ends, but in Java shops Clojure-
2011/9/19 Meikel Brandmeyer (kotarak)
> Hi,
>
> It was recommended in the past to go through the clojure side of things.
> That means for me to call hash-map rather than RT.map. By creating a small
> helper class one can get one's own Clj.map while still going through the
> official API as recomm
Hi,
It was recommended in the past to go through the clojure side of things.
That means for me to call hash-map rather than RT.map. By creating a small
helper class one can get one's own Clj.map while still going through the
official API as recommended. Hence I didn't mention RT.map.
Sincerely
On Sun, Sep 18, 2011 at 3:40 AM, Meikel Brandmeyer wrote:
>> Var keyword = RT.var("clojure.core", "keyword");
>> Var hashMap = RT.var("clojure.core", "hash-map");
>> hashMap.invoke(keyword.invoke("foo"), 1, keyword.invoke("bar"), x);
>
> This one is more simple. This is clojure code.
Since I've e
Hi,
You can also do it the other way around, use gen-class
and write yourself a static entry point callable from Java.
You get all the Clojure runtime init stuff done and you can define your
dependencies in
the clojure file (require or use). Then you can dive into the Clojure world for
as long
Just skimming this on the phone, has no one mentioned RT.map?
On Sep 18, 2011 5:58 PM, "Eamonn" wrote:
> Hi Meikel,Ken
> Thank you so much for taking the time to reply to my question. Meikel
> Thanks for the code. I will implement as described above.
>
> On Sep 18, 6:28 pm, Meikel Brandmeyer wrot
Hi Meikel,Ken
Thank you so much for taking the time to reply to my question. Meikel
Thanks for the code. I will implement as described above.
On Sep 18, 6:28 pm, Meikel Brandmeyer wrote:
> Hi Eamonn,
>
> if you find this too tedious to write and use it quite often, then there is
> always the p
Hi Eamonn,
if you find this too tedious to write and use it quite often, then there is
always the possibility to hide things a little bit behind a facade.
class Clj {
static final Var seqVar = RT.var("clojure.core", "seq");
static final Var keywordVar = RT.var("clojure.core", "keyword");
On Sun, Sep 18, 2011 at 4:40 AM, Meikel Brandmeyer wrote:
> Hi,
>
> Am 18.09.2011 um 10:11 schrieb Ken Wesson:
>
>> Tell me which is simpler:
>>
>> Reader.read("{:foo 1 :bar " + x + "}");
>
> String x = "13rabc";
>
> Have fun.
Syntactically invalid Clojure code would fail just as much in Clojure
Hi,
Am 18.09.2011 um 10:11 schrieb Ken Wesson:
> Tell me which is simpler:
>
> Reader.read("{:foo 1 :bar " + x + "}");
String x = "13rabc";
Have fun.
> Var keyword = RT.var("clojure.core", "keyword");
> Var hashMap = RT.var("clojure.core", "hash-map");
> hashMap.invoke(keyword.invoke("foo"),
On Sun, Sep 18, 2011 at 4:06 AM, Meikel Brandmeyer wrote:
> Am 18.09.2011 um 05:55 schrieb Ken Wesson:
>>
>> The easiest might be to just pass a map literal (in String form)
>> through the Clojure reader. Variable integers or other simple objects
>> can just be incorporated using the Java String +
Am 18.09.2011 um 05:55 schrieb Ken Wesson:
>
> The easiest might be to just pass a map literal (in String form)
> through the Clojure reader. Variable integers or other simple objects
> can just be incorporated using the Java String + operator; the
> concatenation will always start with a string
Hi,
Am 18.09.2011 um 04:58 schrieb Eamonn:
> I tried the following
> Var keyword = RT.var("clojure.core", "keyword");
> Var hashMap = RT.var("clojure.core", "hash-map");
> hashMap.invoke(keyword.invoke("a"), 1);
>
> then I created the following function
> (defn foo[key paramMap](key paramMap))
>
On Sat, Sep 17, 2011 at 10:58 PM, Eamonn wrote:
> Hi Meikel
> Thank you for your reply. Is there a way to populate the HashMap
> before passing it to the invoke method
The easiest might be to just pass a map literal (in String form)
through the Clojure reader. Variable integers or other simple o
Hi Meikel
Thank you for your reply. Is there a way to populate the HashMap
before passing it to the invoke method
I tried the following
Var keyword = RT.var("clojure.core", "keyword");
Var hashMap = RT.var("clojure.core", "hash-map");
hashMap.invoke(keyword.invoke("a"), 1);
then I created the fo
Hi,
Am Donnerstag, 15. September 2011 23:39:10 UTC+2 schrieb Eamonn:
>
>
> The code works BUT if I try to pass in a map for example like so
> Object result = foo.invoke( "hello","world","#{:a 1 :b 2}");
>
>
This does not pass a map to the function, but the string "#{:a 1 :b 2}". And
from your
The problem could be that #{} in clojure is a set literal, try using
clojure.lang.PersistentHashSet/create
>
> Hi
>
> I'm new to Clojure so forgive me if this is a dumb question. I want
> to incorporate some Clojure into a Java application.
>
>String rule="(str key val label)";
>
Hi
I'm new to Clojure so forgive me if this is a dumb question. I want
to incorporate some Clojure into a Java application.
String rule="(str key val label)";
String str = "(ns test) " + "(defn foo [key val label] " +
rule +
18 matches
Mail list logo