How do I require and provide clojure files? -
I have a set of tasks saved in .clj.
How do I provide selected sets of work and then import these functions into my other files?
You have a few options.
If this is just a file (not in the package) then in your files, you can only use load
if your file was named "fun.clj" You will only use the file name without expansion:
(load "fun")
(provided fun.clj
was on your desk). Or
(load "files / funny")
If it is not in your class, but in the files
directory
Or you can use load-file
and it can replace the location of your file:
(load-file ". / Files / Fun.clj ")
If you want to give them the namespace (by putting them in the package), then you have the ns
macro Put the file, then put it on your squares, then you can load it via the Usage
or requirement
.
There are documents for the tasks described here:
Comments
Post a Comment