Skip to content

Commit e2d8d92

Browse files
committed
added ctor values note to interop ref
1 parent a65c91e commit e2d8d92

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

content/reference/java_interop.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Math/PI
6464

6565
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.
6666

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.
6868

6969
The "." forms expand into calls to the dot operator (described below) at macroexpansion time. The expansions are as follows:
7070

@@ -75,9 +75,10 @@ The "." forms expand into calls to the dot operator (described below) at macroex
7575
(.-instanceField instance) ==> (. instance -instanceField)
7676
----
7777

78+
[[methodvalues]]
7879
=== Method values
7980

80-
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.
8182

8283
== The Dot special form
8384

@@ -159,10 +160,12 @@ can be written
159160

160161
the latter expanding into `(new Classname args)` syntax at macro expansion time.
161162

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):
163164

164165
`(Classname/new args*)`
165166

167+
Like methods, qualified constructors `Classname/new` can be used in <<methodvalues#,values contexts>>.
168+
166169
''''
167170

168171
*(_instance?_ Class expr)*

0 commit comments

Comments
 (0)