You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/reference/java_interop.adoc
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ Math/PI
64
64
65
65
The preferred idiomatic forms for accessing field or method members are given above. The instanceMember form works for both fields and methods. The instanceField form is preferred for fields and required if both a field and a 0-argument method of the same name exist.
66
66
67
-
Since Clojure 1.12, `Classname/.instanceMethod` refers to instance method. When an instance method is specified, the instance should be provided after the member and before the args. When a qualified instance method is present then the qualifying class takes precedence over any additional type information on the instance for the purpose of resolving the instance method.
67
+
Since Clojure 1.12, `Classname/.instanceMethod` refers to a qualified instance method. When an instance method is specified, the instance should be provided after the member and before the args. When a qualified instance method is present then the qualifying class takes precedence over any additional type information on the instance for the purpose of resolving the instance method.
68
68
69
69
The "." forms expand into calls to the dot operator (described below) at macroexpansion time. The expansions are as follows:
70
70
@@ -75,9 +75,10 @@ The "." forms expand into calls to the dot operator (described below) at macroex
Since Clojure 1.12, programmers can use Java qualified methods as ordinary functions in value contexts - the compiler will automatically generate the wrapping function. When used as values, qualified methods supply only the class and method name, and thus cannot resolve overloaded methods. Therefore, the compiler will generate a reflective call when a qualified method does not resolve due to overloading. Developers can supply <<link#param-tags,:param-tags metadata>> on qualified methods to specify the signature of a single desired method, 'resolving' it.
81
+
Since Clojure 1.12, programmers can use Java qualified methods as ordinary functions in value contexts - the compiler will automatically generate the wrapping function. When used as values, qualified methods supply only the class and method name, and thus cannot resolve overloaded methods. Therefore, the compiler will generate a reflective call when a qualified method does not resolve due to overloading. Developers can supply <<param-tags#,:param-tags metadata>> on qualified methods to specify the signature of a single desired method, 'resolving' it.
81
82
82
83
== The Dot special form
83
84
@@ -159,10 +160,12 @@ can be written
159
160
160
161
the latter expanding into `(new Classname args)` syntax at macro expansion time.
161
162
162
-
Since Clojure 1.12, this alternate form may also be used (it is not rewritten at macro expansion time):
163
+
Since Clojure 1.12, a qualified form may also be used (it is not rewritten at macro expansion time):
163
164
164
165
`(Classname/new args*)`
165
166
167
+
Like methods, qualified constructors `Classname/new` can be used in <<methodvalues#,values contexts>>.
0 commit comments