-
Notifications
You must be signed in to change notification settings - Fork 157
Basic CLR interop
Blue edited this page Oct 26, 2021
·
2 revisions
All the basic functions for interop mentioned on http://clojure.org/java_interop work as advertised. This includes all of
- Member access
(.instanceMember instance args*)
(.instanceMember Classname args*)
(Classname/staticMethod args*)
Classname/staticField
- Dot special form
(. instance-expr member-symbol)
(. Classname-symbol member-symbol)
-
(. instance-expr (method-symbol args*))
or (. instance-expr method-symbol args*)
-
(. Classname-symbol (method-symbol args*))
or (. Classname-symbol method-symbol args*)
- Instantiation
(Classname. args*)
(new Classname args*)
- Assignment
(set! (. instance-expr instanceFieldName-symbol) expr)
(set! (. Classname-symbol staticFieldName-symbol) expr)
- Miscellaneous
(.. instance-expr member+)
(.. Classname-symbol member+)
(doto instance-expr (instanceMethodName-symbol args*)*)
(instance? Class expr)
(memfn method-name arg-names*)
Most of the array interop functions work.
Note that, in CLR, the names of nested classes are separated from their containing classes with a +
, as in Classname+NestedClassName
, rather than with a $
, as the JVM uses.
The things not implemented yet (and perhaps never):
bean
parse