Skip to content

Commit 5ee7c23

Browse files
authored
Document three missing functions
Signed-off-by: Paul Guyot <[email protected]>
1 parent ae5a475 commit 5ee7c23

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

libs/estdlib/src/erlang.erl

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@
8181
group_leader/0,
8282
process_flag/2,
8383
get_module_info/1,
84-
get_module_info/2
84+
get_module_info/2,
85+
processes/0,
86+
binary_to_term/1,
87+
term_to_binary/1
8588
]).
8689

8790
-export_type([
@@ -874,3 +877,39 @@ get_module_info(_Module) ->
874877
-spec get_module_info(Module :: atom(), InfoKey :: atom()) -> any().
875878
get_module_info(_Module, _InfoKey) ->
876879
erlang:nif_error(undefined).
880+
881+
%%-----------------------------------------------------------------------------
882+
%% @returns A list of pids of all processes
883+
%% @doc Return a list of all current processes.
884+
%% Compared to Erlang/OTP, this function also returns native processes (ports).
885+
%% @end
886+
%%-----------------------------------------------------------------------------
887+
-spec processes() -> [pid()].
888+
processes() ->
889+
erlang:nif_error(undefined).
890+
891+
%%-----------------------------------------------------------------------------
892+
%% @returns A term decoded from passed binary
893+
%% @param Binary binary to decode
894+
%% @doc Decode a term that was previously encodes with `term_to_binary/1'
895+
%% This function should be mostly compatible with its Erlang/OTP counterpart.
896+
%% Unlike modern Erlang/OTP, resources are currently serialized as empty
897+
%% binaries and cannot be unserialized.
898+
%% @end
899+
%%-----------------------------------------------------------------------------
900+
-spec binary_to_term(Binary :: binary()) -> any().
901+
binary_to_term(_Binary) ->
902+
erlang:nif_error(undefined).
903+
904+
%%-----------------------------------------------------------------------------
905+
%% @returns A binary encoding passed term.
906+
%% @param Term term to encode
907+
%% @doc Encode a term to a binary that can later be decoded with `binary_to_term/1'.
908+
%% This function should be mostly compatible with its Erlang/OTP counterpart.
909+
%% Unlike modern Erlang/OTP, resources are currently serialized as empty
910+
%% binaries.
911+
%% @end
912+
%%-----------------------------------------------------------------------------
913+
-spec term_to_binary(Term :: any()) -> binary().
914+
term_to_binary(_Term) ->
915+
erlang:nif_error(undefined).

0 commit comments

Comments
 (0)