Import clojure functions from cans

I play with Clojure and I cannot figure out how to import a function from clojure -contrib.jar. Working with this , I do the following:

Running REPL as follows:

 java -cp clojure.jar:clojure-contrib.jar clojure.main

Then try to import the function:

user=>  (use '[clojure-contrib.duck-streams :only (writer reader)])

This does not work, and I get the following error:

java.io.FileNotFoundException: could not find clojure_contrib / duck_streams__init.class or clojure_contrib / duck_streams.clj in the classpath: (NO_SOURCE_FILE: 0)

Trying with a dot instead of a dash also does not work:

user=>  (use '[clojure.contrib.duck-streams :only (writer reader)])

I get basically the same error:

java.io.FileNotFoundException: Could not find clojure / contrib / duck_streams__init.class or clojure / contrib / duck_streams.clj in classpath: (NO_SOURCE_FILE: 0)

What am I doing wrong?

+3
3

(use 'clojure.contrib)

clojure , ,

(use 'clojure.contrib :only (writer reader))

+1

clojure.jar clojure-contrib.jar ? , JAR CLASSPATH.

+2

This is clojure.contrib, not clojute-contrib. Note that the dot is against the dash.

0
source

Source: https://habr.com/ru/post/1756044/


All Articles