Skip to content

Commit

Permalink
add add-libs preamble from release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Aug 29, 2024
1 parent 9dcf517 commit fb3e631
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/reference/repl_and_main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ Because the `user.clj` file is loaded by the Clojure runtime on initialization,
[[add_lib]]
== Adding libraries for interactive use

The <<xref/../../../guides/install_clojure#,Clojure CLI>> can be used to <<deps_edn#,declare dependencies>> loaded at REPL startup time. Since Clojure 1.12, you can also dynamically load libraries at the REPL for interactive use. These functions are available in the `clojure.repl.deps` namespace:
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.

The <<clojure_cli#,Clojure CLI>> can be used to <<deps_edn#,declare dependencies>> loaded at REPL startup time. Since Clojure 1.12, you can also dynamically load libraries at the REPL for interactive use. These functions are available in the `clojure.repl.deps` namespace:

* https://clojure.github.io/clojure/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 version or git tag (if the library has an inferred git repo name) are used.
* https://clojure.github.io/clojure/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.
Expand Down

0 comments on commit fb3e631

Please sign in to comment.