Packages
kirala_l4u
0.1.1
An embedded lisp interpreter based on the gleam implementation of MAL lisp.
Current section
Files
Jump to
Current section
Files
src/l4u@sys_bridge.erl
-module(l4u@sys_bridge).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([erl_sym/1, l4u_to_native/1, native_to_l4u/1, to_string/1, unique_pdic/0, aux_pdic/2, console_readline/1, console_writeln/1, do_async/1, dbgout1/1, dbgout2/2, dbgout3/3, dbgout4/4, catch_ex/1, catch_dummy/1, throw_err/1, throw_expr/1, load_file/1, make_ref/1, deref/1, reset_ref/2, internal_form/1, external_form/1, new_process/1, exec/2, exec_native/2, get_command_line_args/0, escape_binary_string/1, unescape_binary_string/1, tick_count/0, unique_int/0, unique_str/0, compare_any/2, os_cmd/1, stringify/1, error_to_string/2, process_dict_set/3, process_dict_get/2, process_dict_erase/2, process_dict_keys/1, file_exists/1, dir_exists/1, get_cwd/0, set_cwd/1, abspath/1, tco_loop/2]).
-export_type([pid_/0, erl_sym/0]).
-type pid_() :: any().
-type erl_sym() :: any().
-spec erl_sym(binary()) -> erl_sym().
erl_sym(Str) ->
erlang:binary_to_atom(Str).
-spec l4u_to_native(l4u@l4u_type:expr()) -> any().
l4u_to_native(Value) ->
l4u_ffi:l4u_to_native(Value).
-spec native_to_l4u(gleam@dynamic:dynamic_()) -> any().
native_to_l4u(Value) ->
l4u_ffi:native_to_l4u(Value).
-spec to_string(any()) -> binary().
to_string(X) ->
l4u_ffi:to_bin_string(X).
-spec unique_pdic() -> l4u@l4u_type:p_dic().
unique_pdic() ->
l4u@sys_bridge_ffi:unique_pdic().
-spec aux_pdic(l4u@l4u_type:p_dic(), binary()) -> l4u@l4u_type:p_dic().
aux_pdic(Pdic, Id) ->
l4u@sys_bridge_ffi:aux_pdic(Pdic, Id).
-spec console_readline(binary()) -> binary().
console_readline(Prompt) ->
l4u@sys_bridge_ffi:console_readline(Prompt).
-spec console_writeln(any()) -> nil.
console_writeln(S) ->
l4u@sys_bridge_ffi:console_writeln(S).
-spec do_async(fun(() -> nil)) -> nil.
do_async(F) ->
l4u@sys_bridge_ffi:do_async(F).
-spec dbgout1(any()) -> boolean().
dbgout1(A) ->
l4u@sys_bridge_ffi:dbgout1(A).
-spec dbgout2(any(), any()) -> boolean().
dbgout2(A, B) ->
l4u@sys_bridge_ffi:dbgout2(A, B).
-spec dbgout3(any(), any(), any()) -> boolean().
dbgout3(A, B, C) ->
l4u@sys_bridge_ffi:dbgout3(A, B, C).
-spec dbgout4(any(), any(), any(), any()) -> boolean().
dbgout4(A, B, C, D) ->
l4u@sys_bridge_ffi:dbgout4(A, B, C, D).
-spec catch_ex(fun(() -> FMO)) -> {ok, FMO} | {error, any()}.
catch_ex(Try_fn) ->
l4u@sys_bridge_ffi:catch_ex(Try_fn).
-spec catch_dummy(fun(() -> FMS)) -> {ok, FMS} | {error, any()}.
catch_dummy(Try_fn) ->
{ok, Try_fn()}.
-spec throw_err(binary()) -> nil.
throw_err(S) ->
l4u@sys_bridge_ffi:throw_err(S).
-spec throw_expr(any()) -> nil.
throw_expr(Expr) ->
l4u@sys_bridge_ffi:throw_expr(Expr).
-spec load_file(binary()) -> binary().
load_file(Filename) ->
l4u@sys_bridge_ffi:load_file(Filename).
-spec make_ref(any()) -> l4u@l4u_type:ref().
make_ref(Value) ->
l4u@sys_bridge_ffi:make_ref(Value).
-spec deref(l4u@l4u_type:ref()) -> any().
deref(Ref) ->
l4u@sys_bridge_ffi:deref(Ref).
-spec reset_ref(l4u@l4u_type:ref(), FMZ) -> FMZ.
reset_ref(Ref, Value) ->
l4u@sys_bridge_ffi:reset_ref(Ref, Value).
-spec internal_form(any()) -> binary().
internal_form(Value) ->
l4u@sys_bridge_ffi:internal_form(Value).
-spec external_form(any()) -> binary().
external_form(Value) ->
l4u@sys_bridge_ffi:external_form(Value).
-spec new_process(fun(() -> any())) -> {ok, pid_()} | {error, any()}.
new_process(Initializer) ->
l4u@process:new_process(Initializer).
-spec exec(pid_(), fun((any()) -> FNH)) -> {ok, FNH} | {error, any()}.
exec(Pid, F) ->
l4u@process:exec(Pid, F).
-spec exec_native(pid_(), fun((any()) -> FNM)) -> {ok, FNM} | {error, any()}.
exec_native(Pid, F) ->
l4u@process:exec_native(Pid, F).
-spec get_command_line_args() -> list(binary()).
get_command_line_args() ->
l4u@sys_bridge_ffi:get_command_line_args().
-spec escape_binary_string(binary()) -> binary().
escape_binary_string(Str) ->
l4u@sys_bridge_ffi:escape_binary_string(Str).
-spec unescape_binary_string(binary()) -> binary().
unescape_binary_string(Str) ->
l4u@sys_bridge_ffi:unescape_binary_string(Str).
-spec tick_count() -> integer().
tick_count() ->
l4u@sys_bridge_ffi:tick_count().
-spec unique_int() -> integer().
unique_int() ->
l4u@sys_bridge_ffi:unique_int().
-spec unique_str() -> binary().
unique_str() ->
l4u@sys_bridge_ffi:unique_str().
-spec compare_any(l4u@l4u_type:expr(), l4u@l4u_type:expr()) -> gleam@order:order().
compare_any(X, Y) ->
l4u@sys_bridge_ffi:compare_any(X, Y).
-spec os_cmd(binary()) -> binary().
os_cmd(Cmdline) ->
l4u@sys_bridge_ffi:os_cmd(Cmdline).
-spec stringify(any()) -> binary().
stringify(X) ->
l4u@sys_bridge_ffi:stringify(X).
-spec error_to_string(any(), boolean()) -> binary().
error_to_string(X, Verbose) ->
l4u@sys_bridge_ffi:error_to_string(X, Verbose).
-spec process_dict_set(l4u@l4u_type:p_dic(), binary(), any()) -> nil.
process_dict_set(Pdic, Key, Value) ->
l4u@sys_bridge_ffi:process_dict_set(Pdic, Key, Value).
-spec process_dict_get(l4u@l4u_type:p_dic(), binary()) -> any().
process_dict_get(Pdic, Key) ->
l4u@sys_bridge_ffi:process_dict_get(Pdic, Key).
-spec process_dict_erase(l4u@l4u_type:p_dic(), binary()) -> any().
process_dict_erase(Pdic, Key) ->
l4u@sys_bridge_ffi:process_dict_erase(Pdic, Key).
-spec process_dict_keys(l4u@l4u_type:p_dic()) -> list(binary()).
process_dict_keys(Pdic) ->
l4u@sys_bridge_ffi:process_dict_keys(Pdic).
-spec file_exists(binary()) -> boolean().
file_exists(File_path) ->
l4u@sys_bridge_ffi:file_exists(File_path).
-spec dir_exists(binary()) -> boolean().
dir_exists(Dir_path) ->
l4u@sys_bridge_ffi:dir_exists(Dir_path).
-spec get_cwd() -> binary().
get_cwd() ->
l4u@sys_bridge_ffi:get_cwd().
-spec set_cwd(binary()) -> nil.
set_cwd(Dir_path) ->
l4u@sys_bridge_ffi:set_cwd(Dir_path).
-spec abspath(binary()) -> binary().
abspath(Path) ->
l4u@sys_bridge_ffi:abspath(Path).
-spec tco_loop(any(), any()) -> any().
tco_loop(F, Initial_param) ->
gleam@dynamic:unsafe_coerce(gleam@dynamic:from(nil)).