Skip to content

Commit 1947922

Browse files
committed
fix xrefs
1 parent 5a015fb commit 1947922

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

content/news/2024/09/05/clojure-1-12-0.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Updated dependencies:
4343

4444
There are many development-time cases where it would be useful to add a library interactively without restarting the JVM - speculative evaluation, adding a known dependency to your project, or adding a library to accomplish a specific task.
4545

46-
Clojure now provides <<xref/../../../repl_and_main#add_lib,new functions to add libraries interactively>>, without restarting the JVM or losing the state of your work:
46+
Clojure now provides <<xref/../../../../../reference/repl_and_main#add_lib,new functions to add libraries interactively>>, without restarting the JVM or losing the state of your work:
4747

4848
* https://clojure.github.io/clojure/branch-master/clojure.repl-api.html#clojure.repl.deps/add-lib[add-lib] takes a lib that is not available on the classpath, and makes it available by downloading (if necessary) and adding to the classloader. Libs already on the classpath are not updated. If the coordinate is not provided, the newest Maven or git (if the library has an inferred git repo name) version or tag are used.
4949
* https://clojure.github.io/clojure/branch-master/clojure.repl-api.html#clojure.repl.deps/add-libs[add-libs] is like `add-lib`, but resolves a set of new libraries and versions together.
@@ -74,7 +74,7 @@ For a long time, we've had the `clojure.java.shell` namespace, but over time Jav
7474

7575
Clojure programmers often want to use Java methods in higher-order functions (e.g. passing a Java method to `map`). Until now, programmers have had to manually wrap methods in functions. This is verbose, and might require manual hinting for overload disambiguation, or incur incidental reflection or boxing.
7676

77-
Programmers can now use <<clojure-1-12-0#qualified_methods,qualified methods>> as ordinary functions in value contexts - the compiler will <<xref/../../../reference/java_interop#methodvalues,automatically generate the wrapping function>>. The compiler will generate a reflective call when a qualified method does not resolve due to overloading. Developers can supply <<clojure-1-12-0#param_tags,`:param-tags`>> metadata on qualified methods to specify the signature of a single desired method, 'resolving' it.
77+
Programmers can now use <<clojure-1-12-0#qualified_methods,qualified methods>> as ordinary functions in value contexts - the compiler will <<xref/../../../../../reference/java_interop#methodvalues,automatically generate the wrapping function>>. The compiler will generate a reflective call when a qualified method does not resolve due to overloading. Developers can supply <<clojure-1-12-0#param_tags,`:param-tags`>> metadata on qualified methods to specify the signature of a single desired method, 'resolving' it.
7878

7979
[[qualified_methods]]
8080
### 2.5 Qualified methods - `Class/method`, `Class/.method`, and `Class/new`
@@ -98,23 +98,23 @@ Note: Static fields are values and should be referenced without parens unless th
9898
9999
When used as values, qualified methods supply only the class and method name, and thus cannot resolve overloaded methods.
100100
101-
Developers can supply <<xref/../../../reference/java_interop#paramtags,`:param-tags`>> metadata on qualified methods to specify the signature of a single desired method, 'resolving' it. The `:param-tags` metadata is a vector of zero or more tags: `[tag ...]`. A tag is any existing valid `:tag` metadata value. Each tag corresponds to a parameter in the desired signature (arity should match the number of tags). Parameters with non-overloaded types can use the placeholder `_` in lieu of the tag. When you supply :param-tags metadata on a qualified method, the metadata must allow the compiler to resolve it to a single method at compile time.
101+
Developers can supply <<xref/../../../../../reference/java_interop#paramtags,`:param-tags`>> metadata on qualified methods to specify the signature of a single desired method, 'resolving' it. The `:param-tags` metadata is a vector of zero or more tags: `[tag ...]`. A tag is any existing valid `:tag` metadata value. Each tag corresponds to a parameter in the desired signature (arity should match the number of tags). Parameters with non-overloaded types can use the placeholder `_` in lieu of the tag. When you supply :param-tags metadata on a qualified method, the metadata must allow the compiler to resolve it to a single method at compile time.
102102

103103
A new metadata reader syntax `^[tag ...]` attaches `:param-tags` metadata to member symbols, just as `^tag` attaches `:tag` metadata to a symbol.
104104

105105
### 2.7 Array class syntax
106106

107107
Clojure supports symbols naming classes both as a value (for class object) and as a type hint, but has not provided syntax for array classes other than strings.
108108

109-
Developers can now refer to an <<xref/../../../reference/java_interop#_class_access,array class>> using a symbol of the form `ComponentClass/#dimensions`, eg `String/2` refers to the class of a 2 dimensional array of Strings. Component classes can be fully-qualified classes, imported classes, or primitives. Array class syntax can be used as both type hints and values.
109+
Developers can now refer to an <<xref/../../../../../reference/java_interop#_class_access,array class>> using a symbol of the form `ComponentClass/#dimensions`, eg `String/2` refers to the class of a 2 dimensional array of Strings. Component classes can be fully-qualified classes, imported classes, or primitives. Array class syntax can be used as both type hints and values.
110110

111111
Examples: `String/1`, `java.lang.String/1`, `long/2`.
112112

113113
### 2.8 Functional interfaces
114114

115115
Java programs emulate functions with Java functional interfaces (marked with the https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html[@FunctionalInterface] annotation), which have a single method.
116116

117-
Clojure developers can now invoke Java methods taking <<xref/../../../reference/java_interop#functional_interfaces,functional interfaces>> by passing functions with matching arity. The Clojure compiler implicitly converts Clojure functions to the required functional interface by constructing a lambda adapter. You can explicitly coerce a Clojure function to a functional interface by hinting the binding name in a `let` binding, e.g. to avoid repeated adapter construction in a loop, e.g. `(let [^java.util.function.Predicate p even?] ...)`.
117+
Clojure developers can now invoke Java methods taking <<xref/../../../../../reference/java_interop#functional_interfaces,functional interfaces>> by passing functions with matching arity. The Clojure compiler implicitly converts Clojure functions to the required functional interface by constructing a lambda adapter. You can explicitly coerce a Clojure function to a functional interface by hinting the binding name in a `let` binding, e.g. to avoid repeated adapter construction in a loop, e.g. `(let [^java.util.function.Predicate p even?] ...)`.
118118

119119
### 2.9 Java Supplier interop
120120

@@ -124,7 +124,7 @@ Calling methods that take a https://docs.oracle.com/javase/8/docs/api/java/util/
124124

125125
Java APIs increasingly return https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html[Stream]s and are hard to consume because they do not implement interfaces that Clojure already supports, and hard to interop with because Clojure doesn't directly implement Java functional interfaces.
126126

127-
In addition to functional interface support, Clojure <<xref/../../../reference/java_interop#streams,now provides these functions>> to interoperate with streams in an idiomatic manner, all functions behave analogously to their Clojure counterparts:
127+
In addition to functional interface support, Clojure <<xref/../../../../../reference/java_interop#streams,now provides these functions>> to interoperate with streams in an idiomatic manner, all functions behave analogously to their Clojure counterparts:
128128

129129
* `(stream-seq! stream) => seq`
130130
* `(stream-reduce! f [init-val] stream) => val`

0 commit comments

Comments
 (0)