store/[org.clojure/clojure "1.9.0"] clj::clojure.core/load-file

Official Documentation

Add notes

  Sequentially read and evaluate the set of forms contained in the file.

Example 1

;; file located at src/address_book/core.clj
;; current dir is src/..

(load-file "src/address_book/core.clj")

Example 2

;; create a clojure file on the fly using spit
;; then load it into the REPL and use its function

(spit "mycode.clj" "(defn doub [x] (* x 2))")
;; => nil

(load-file "mycode.clj")
;; => #'user/doub

(doub 23)
;; => 46

Example 3

;; Very useful from a REPL
;; Paths are specified as strings using canonical file path notation 
;; (rather than clojure-style namespaces dependent on the JVM classpath).
;; The working directory is set to wherever you invoked the JVM from, 
;; likely the project root.

(load-file "src/mylib/core.clj")

;; now you can go and evaluate vars defined in that file.

Uses on crossclj