Html/CSS
erlang 标签描述

此方法用于将二进制值转换为浮点值。 binary_to_float语法 binary_to_float(binaryvalue) binaryvalue - 这是需要转换为浮点值的二进制值。 binary_to_float返回值 从二进制值返回浮点值。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[binary_to_float(<<"2.2">>)]). 当我们运行上面的程序时,我们将得到以下输出。 2.2 参考链接 https://w...

  raKFu9QULpEG   2023年12月07日   14   0   0 Erlangerlang

此方法返回元组{MegaSecs,Secs,MicroSecs},它是从1970年1月1日格林威治标准时间00:00开始经过的时间。 now语法 now() now返回值 返回元组{MegaSecs,Secs,MicroSecs},它是从1970年1月1日格林威治标准时间00:00开始经过的时间。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[erlang:now()]). 当我们运行上述程序时,我们将得到以下输出。根据系统,输出将有所不同。 {1460,893073,767749} ...

  raKFu9QULpEG   2023年12月07日   55   0   0 Erlangerlang

此方法用于将二进制值转换为列表。 binary_to_list语法 binary_to_list(binaryvalue) binaryvalue- 这是需要转换为列表的二进制值。 binary_to_list返回值 返回列表。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[binary_to_list(<<2,1>>)]). 当我们运行上面的程序时,我们将得到以下输出。 [2,1] 参考链接 https://www.learnfk.com/erl...

  raKFu9QULpEG   2023年12月07日   7   0   0 Erlangerlang

返回一个列表,其中包含有关由Erlang动态分配的内存的信息,该列表的每个元素都是一个元组{Type,Size},第一个元素Type是描述内存类型的原子。 memory语法 memory() memory返回值 返回一个列表,其中包含有关由Erlang仿真器动态分配的内存的信息。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[erlang:memory()]). 当我们运行上面的程序时,我们将得到以下输出。根据系统,输出将有所不同 [{total,15515688}, {processes...

  raKFu9QULpEG   2023年12月07日   17   0   0 Erlangerlang

如果本地节点处于活动状态并且可以是分布式系统的一部分,则返回true。否则,它返回false。 is_alive语法 is_alive() is_alive返回值 如果本地节点处于活动状态并且可以是分布式系统的一部分,则返回true。否则,它返回false。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("p",[is_alive()]). 当我们运行上述程序时,我们将得到以下输出。 false 参考链接 https://www.learnfk.com/erlang/erlang-is-alive...

  raKFu9QULpEG   2023年12月08日   37   0   0 Erlangerlang

该方法返回元组中的第Nth元素。 element语法 element(N,Tuple) N    元组中需要返回的位置。 Tuple 需要为其返回第N元素的元组。 element返回值 该方法返回元组中的第Nth元素。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[element(2,{a,b,c})]). 当我们运行上述程序时,我们将得到以下输出。 b 参考链接 https://www.learnfk.com/erlang/erla...

  raKFu9QULpEG   2023年12月07日   8   0   0 Erlangerlang

这用于创建新进程并对其进行初始化。 spawn语法 spawn(Function) Function - 需要产生的功能。 spawn返回值 此方法返回一个进程ID。 -module(helloLearnfk). -export([start/0]). start()-> spawn(fun()->server("Hello")end). server(Message)-> io:fwrite("p",[Message]). 当我们运行上述程序时,我们将得到以下输出。 “Hello” 参考链接 https://www.learnfk.co...

  raKFu9QULpEG   2023年12月08日   14   0   0 Erlangerlang

此方法将元组转换为列表。 tuple_to_list语法 tuple_to_list(list) list - 这是需要转换为列表的元组。 tuple_to_list返回值 根据提供的元组返回一个列表。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("w",[tuple_to_list({1,2,3})]). 上面程序的输出如下 [1,2,3] 参考链接 https://www.learnfk.com/erlang/erlang-tuple-to-list.html ...

  raKFu9QULpEG   2023年12月07日   17   0   0 Erlangerlang

返回与本地节点上当前存在的所有进程相对应的进程标识符的列表。 processes语法 processes() processes返回值 返回与本地节点上当前存在的所有进程相对应的进程标识符的列表。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[erlang:processes()]). 当我们运行上面的程序时,我们将得到以下输出。根据系统,输出将有所不同。 [<0.0.0>,<0.2.0>,<0.3.0>,<0.6.0>,<0.7.0&...

  raKFu9QULpEG   2023年12月07日   14   0   0 Erlangerlang

此方法用于检查位串是否确实是二进制值。 is_binary语法 is_binary(bitstring) bitstring这是需要检查其是否为二进制的位串。 is_binary返回值 如果位串是二进制值,则返回true;否则返回false。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[is_binary(<<1,2,3>>)]). 当我们运行上面的程序时,我们将得到以下输出。 true 参考链接 https://www.learnfk.com/erlang...

  raKFu9QULpEG   2023年12月07日   15   0   0 Erlangerlang

此方法用于提取二进制字符串的一部分。 binary_part语法 binary_part(bitstring,{startposition,len}) bitstring    这是需要拆分的位串。 startposition这是从其开始子位串的索引位置。 len          - 这是子位串的长度。 binary_part返回值 返回子位串。 -module(helloLearnfk). -export([start/0]). ...

  raKFu9QULpEG   2023年12月07日   13   0   0 Erlangerlang

此方法用于从Map返回所有键。 keys语法 keys(map) map - 这是需要为其返回所有键的映射。 keys返回值 返回Map中的键列表。 -module(helloLearnfk). -export([start/0]). start()-> Lst1=[{"a",1},{"b",2},{"c",3}], Map1=maps:from_list(Lst1), io:fwrite("pn",[maps:keys(Map1)]). 上面程序的输出如下。 ["a","b","c"] 参考链接 https://www.learnfk.com/erl...

  raKFu9QULpEG   2023年12月07日   11   0   0 Erlangerlang

这用于在系统中注册进程。 register语法 register(atom,pid) atom这是要赋予该过程的注册名称。 pid  这是需要绑定到原子的进程ID。 register示例 -module(helloLearnfk). -export([start/0,call/2]). call(Arg1,Arg2)-> io:fwrite("pn",[Arg1]). start()-> Pid=spawn(?MODULE,call,["hello","process"]), register(myprocess,Pid), io:fwrite("...

  raKFu9QULpEG   2023年12月08日   35   0   0 Erlangerlang

这用于注销系统中的进程。 unregister语法 unregister(atom) atom这是要赋予该过程的注册名称。 unregister示例 -module(helloLearnfk). -export([start/0,call/2]). call(Arg1,Arg2)-> io:fwrite("pn",[Arg1]). start()-> Pid=spawn(?MODULE,call,["hello","learnfk.com"]), register(myprocess,Pid), io:fwrite("pn",[whereis(myprocess)])...

  raKFu9QULpEG   2023年12月08日   43   0   0 Erlangerlang

此方法是将列表转换为元组。 list_to_tuple语法 list_to_tuple(list) list - 这是需要转换为元组的列表。 list_to_tuple返回值 根据提供的列表返回一个元组。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("w",[list_to_tuple([1,2,3])]). 上面程序的输出如下 {1,2,3} 参考链接 https://www.learnfk.com/erlang/erlang-list-to-tuple.html ...

  raKFu9QULpEG   2023年12月07日   10   0   0 Erlangerlang

此方法用于将现有列表转换为二进制列表。 list_to_binary语法 list_to_binary(lst) lst  - 这是需要转换为二进制值的列表。 list_to_binary返回值 返回列表的位串。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[list_to_binary([1,2,3])]). 当我们运行上面的程序时,我们将得到以下输出。 <<1,2,3>> 参考链接 https://www.learnfk.c...

  raKFu9QULpEG   2023年12月07日   16   0   0 Erlangerlang

此方法用于确定所提供的术语确实是元组。 is_tuple语法 is_tuple(tuple) tuple这是要验证的元组是否真的是元组。 is_tuple返回值 如果确实输入的值是元组,则返回true,否则将返回false。 -module(helloLearnfk). -export([start/0]). start()-> P={john,24,{june,25}}, io:fwrite("w",[is_tuple(P)]). 上面程序的输出如下 true 参考链接 https://www.learnfk.com/erlang/erlang-is-tuple.html...

  raKFu9QULpEG   2023年12月07日   26   0   0 Erlangerlang

此方法用于将术语转换为二进制。 term_to_binary语法 term_to_binary(term) term这是需要转换为二进制值的术语值。 term_to_binary返回值 根据指定的术语返回一个二进制值。 -module(helloLearnfk). -export([start/0]). start()-> io:fwrite("pn",[term_to_binary("hello")]). 当我们运行上面的程序时,我们将得到以下输出。 {<<131,107,0,5,104,101,108,108,111>>} 参考链接 https:...

  raKFu9QULpEG   2023年12月07日   14   0   0 Erlangerlang

此方法用于确定进程ID是否存在。 is_pid语法 Is_pid(processid) processid  - 这是需要检查的进程ID,是否存在。 is_pid返回值 如果进程ID存在,则返回true,否则将返回false。 -module(helloLearnfk). -export([start/0,call/2]). call(Arg1,Arg2)-> io:format("ppn",[Arg1,Arg2]). start()-> Pid=spawn(?MODULE,call,["hello","learnfk.com"]), i...

  raKFu9QULpEG   2023年12月07日   9   0   0 Erlangerlang

最常用的BIF之一,返回调用进程的pid。 self语法 self() self返回值 返回调用进程的pid。 -module(helloLearnfk). -export([start/0]). start()-&gt; io:fwrite("pn",[self()]). 当我们运行上述程序时,我们将得到以下输出。 &lt;0.2.0&gt; 参考链接 https://www.learnfk.com/erlang/erlang-self.html <!-本文包含:- <!--

  raKFu9QULpEG   2023年12月08日   32   0   0 Erlangerlang