Been trying to get through this, for about 3 1/2 hours, and can't seem to get a handle on it.
I've included the Clojure jar
#AdditionalJar: clojure-1.6.0
, and am trying to reproduce the code at the bottom, but can't even get past the first InitializeNewInstance.
Some of my code is as follows.
Naturally, I can't get to the point of getting to the next assignment, which I think would be
, or any further.
Here's the Java code I'm trying to reproduce, in B4J, from the bottom of http://clojure.org/java_interop:
The public Java API for Clojure consists of the following classes and interfaces:
clojure.java.api.Clojure
clojure.lang.IFn
All other Java classes should be treated as implementation details, and applications should avoid relying on them.
To lookup and call a Clojure function:
IFn plus = Clojure.var("clojure.core", "+");
plus.invoke(1, 2);
Can anyone offer some tips?
I've included the Clojure jar
#AdditionalJar: clojure-1.6.0
, and am trying to reproduce the code at the bottom, but can't even get past the first InitializeNewInstance.
Some of my code is as follows.
B4X:
'...
'...
Dim oClojure As JavaObject
'...
'...
' This keeps generating a classnotfound exception. Since the jar is in the classpath and compiles ok,
' I don't know why it's not finding it.
oClojure.InitializeNewInstance( "clojure.java.api.Clojure", Null )
Naturally, I can't get to the point of getting to the next assignment, which I think would be
B4X:
oIFn = oClojure.RunMethodJO( "clojure.core", Array As Object( "var" ) )
, or any further.
Here's the Java code I'm trying to reproduce, in B4J, from the bottom of http://clojure.org/java_interop:
The public Java API for Clojure consists of the following classes and interfaces:
clojure.java.api.Clojure
clojure.lang.IFn
All other Java classes should be treated as implementation details, and applications should avoid relying on them.
To lookup and call a Clojure function:
IFn plus = Clojure.var("clojure.core", "+");
plus.invoke(1, 2);
Can anyone offer some tips?