clj_compiler
Clojerl compiler's entrypoint.
Provides functions to compile files, strings and forms.Summary
Types
Functions
-
eval(Form)
Equivalent to
eval(Form, default_options())
. -
eval(Form, Opts)
Evaluates a form.
-
file(File)
Equivalent to
file(File, default_options())
. -
file(File, Opts)
Compiles the file whose path is
File
using the provided options. -
load(PushbackReader)
Compiles and load code from avoid reader.
-
load_file(Path)
Compiles and load code from a file.
-
load_string(Src)
Compiles and load code from a string.
-
string(Src)
Equivalent to
string(Src, default_options())
. -
string(Src, Opts)
Compiles the code in
Src
using the provided options.
Types
clj_flag()
-type clj_flag() ::
'no-warn-symbol-as-erl-fun' | 'no-warn-dynamic-var-name'.
compiled_modules()
-type compiled_modules() :: [file:filename_all()].
options()
-type options() ::
#{clj_flags => [clj_flag()],
file => string(),
reader_opts => map(),
time => boolean(),
output => binary | asm | core,
fake => boolean()}.
Functions
eval(Form)
-spec eval(any()) -> {any(), clj_env:env()}.
Equivalent to eval(Form, default_options())
.
eval(Form, Opts)
-spec eval(any(), options()) -> {any(), clj_env:env()}.
Evaluates a form.
Returns the evaluated value for the form and the resultingclj_env:env()
compilation context.
file(File)
-spec file(file:filename_all()) -> compiled_modules().
Equivalent to file(File, default_options())
.
file(File, Opts)
-spec file(file:filename_all(), options()) -> compiled_modules().
Compiles the file whose path is File
using the provided options.
load(PushbackReader)
-spec load('erlang.io.PushbackReader':type()) -> any().
Compiles and load code from avoid reader.
Returns the value of the last expression.
load_file(Path)
-spec load_file(binary()) -> any().
Compiles and load code from a file.
Returns the value of the last expression.
load_string(Src)
-spec load_string(binary()) -> any().
Compiles and load code from a string.
Returns the value of the last expression.
string(Src)
-spec string(binary()) -> clj_env:env().
Equivalent to string(Src, default_options())
.
string(Src, Opts)
-spec string(binary(), options()) -> clj_env:env().
Compiles the code in Src
using the provided options.
clj_env:env()
compilation context.