Skip to content

Commit 272b344

Browse files
committed
formatting
1 parent 6672b55 commit 272b344

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

content/reference/java_interop.adoc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ toc::[]
1818
[%hardbreaks]
1919
**Classname[$InnerClass][pass:[*]]**
2020

21-
Symbols representing class names are resolved to the Class instance. Inner or nested classes are separated from their outer class with a `$`. Fully-qualified class names are always valid. If a class is import`ed in the namespace, it may be used without qualification.
21+
Symbols representing class names are resolved to the Class instance. Inner or nested classes are separated from their outer class with a `$`. Fully-qualified class names are always valid. If a class is import`ed in the namespace, it may be used without qualification. All classes in java.lang are automatically imported to every namespace.
2222

2323
Since 1.12, class symbols may end in one or more pass:[*]s to refer to an array of the class. The number of pass:[*]s indicates the array dimension. Array classes may also use a primitive component, e.g. `pass:[long*]`.
2424

25-
All classes in java.lang are automatically imported to every namespace.
26-
2725
[source,clojure-repl]
2826
----
2927
String
@@ -59,11 +57,7 @@ Math/PI
5957
-> 3.141592653589793
6058
----
6159

62-
The preferred idiomatic forms for accessing field or method members are given above. The instance member 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.
63-
64-
Since Clojure 1.12, instance method symbols may be qualified with the Class name.
65-
66-
All idiomatic forms expand into calls to the dot operator (described below) at macroexpansion time. The expansions are as follows:
60+
The preferred idiomatic forms for accessing field or method members are given above. The instance member 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. Since Clojure 1.12, instance method symbols may be qualified with the Class name. They all expand into calls to the dot operator (described below) at macroexpansion time. The expansions are as follows:
6761

6862
[source,clojure]
6963
----
@@ -97,6 +91,8 @@ If the second operand is a symbol and no args are supplied it is taken to be a f
9791

9892
If the second operand is a list, or args are supplied, it is taken to be a method call. The first element of the list must be a simple symbol, and the name of the method is the name of the symbol. The args, if any, are evaluated from left to right, and passed to the matching method, which is called, and its value returned. If the method has a void return type, the value of the expression will be _**nil**_. Note that placing the method name in a list with any args is optional in the canonic form, but can be useful to gather args in macros built upon the form.
9993

94+
Since Clojure 1.12,
95+
10096
Note that boolean return values will be turned into Booleans, chars will become Characters, and numeric primitives will become Numbers unless they are immediately consumed by a method taking a primitive.
10197

10298
The member access forms given at the top of this section are preferred for use in all cases other than in macros.

0 commit comments

Comments
 (0)