Replaced Clojure Functions
A number of standard functions from Clojure's standard library clojure::core
have been replaced by functions in the ys::std library.
In general the replacements have the same intent as the original functions, but
from a YS perspective.
When you absolutely need the original Clojure functions, they are available in
this ys::clj library.
Use the library with an alias before using the clj/ prefix:
use: clj
Functions🔗
The documentation for these functions is available in the Clojure documentation web site, so we include a link to there in each definition.
-
clj/compile— In Clojurethe
compilefunction compiles a namespace into a set of class files. In YS it converts a YS source code string into a Clojure source code string. -
clj/load— In Clojurethe
loadfunction loads a file from the classpath. In YS it's an alias forload-file(below). -
clj/load-file— In Clojurethe
load-filefunction loads a Clojure file from a given file path. In YS it loads a YS file from a given file path. -
clj/load-readerloads and evaluates Clojure forms from a reader. -
clj/line-seqpreserves the original Clojure reader sequence helper. -
clj/flush,clj/newline,clj/print,clj/printf,clj/println,clj/pr, andclj/prnpreserve the original Clojure output functions. -
clj/readandclj/read-linepreserve the original Clojure input functions.
The Clojure slurp and spit functions are not exposed.
Use read and write, which are backed by ys::fs.
-
clj/num— In Clojurethe
numfunction converts a Java number to a Clojure number. In YS it converts a numeric string to a number. -
clj/use— In Clojurethe
usefunction is used to refer a namespace into the current namespace. In YS it loads a YS or Clojure library fromYSPATH.