clojure.core/load-file¶
Sequentially read and evaluate the set of forms contained in the file.
Examples¶
Note by dedeibel¶
Be aware that this function is intended to load code only. If your data structures or a string in them grow bigger than around 65,535 it crashes.
Exception similar to:
java.lang.ClassFormatError: Unknown constant tag 49 in class file parse$eval13
Please use read-string instead.
Example:
(read-string (slurp "data.clj"))
Source: Google Groups
Note by arkh¶
The following marginally helpful error will be thrown if you have a typo in your file:
CompilerException java.lang.RuntimeException: Unable to resolve symbol: load-file in this context, compiling:(NO_SOURCE_PATH:1:1)
Fix the syntax error(s) in and you'll be able to use load-file again.
See also¶
Content from the matching ClojureDocs page, with authors credited on each contribution.