1. working folder
> pwd().
2. 变量首写字母必须[大写]。
3. 原子以[小写]字母开头,它只是一个名字,不是变量。
4. 元组{inch,2},大小固定
5. 列表
[{moscow, {c, -10}}, {cape_town, {f, 70}}]
[First|Last]=[1,2,3,4,5]
First=1
Last=[2,3,4,5]
L1 = [madrid | T1].
6. 没有字符串,可用字符列表来表示,
5> [97,98,99].
"abc"
7. ERLANG 标准模块帮助手册
$erl -man io
$erl -man erl
32> io:format("hello world~n", []).
hello world
33> io:format("this outputs one Erlang term: ~w~n", [hello]).
this outputs one Erlang term: hello
34> io:format("this outputs two Erlang terms: ~w~w~n", [hello, world]).
this outputs two Erlang terms: helloworld
35> io:format("this outputs two Erlang terms: ~w ~w~n", [hello, world]).
this outputs two Erlang terms: hello world
8. IF 语句
if
Condition 1 ->
Action 1;
Condition 2 ->
Action 2;
Condition 3 ->
Action 3;
Condition 4 ->
Action 4 % 没有;号表示结束
end.
9. list模块的foreach和map函数
foreach 带入一下列表,并把每一个元素,作用于一个函数 fun 中,map 通过一个函数 fun 来创立出一个新的列表。
foreach(Fun, [First|Rest]) ->
Fun(First),
foreach(Fun, Rest);
foreach(Fun, []) ->
ok.
map(Fun, [First|Rest]) ->
[Fun(First)|map(Fun,Rest)];
map(Fun, []) ->
[].
---------------------------
92> Add_3 = fun(X) -> X + 3 end.
#Fun<erl_eval.5.123085357>
93> lists:map(Add_3, [1,2,3]).
[4,5,6]
10. ** shell internal commands **
b() -- display all variable bindings
e(N) -- repeat the expression in query <N>
f() -- forget all variable bindings
f(X) -- forget the binding of variable X
h() -- history
history(N) -- set how many previous commands to keep
results(N) -- set how many previous command results to keep
v(N) -- use the value of query <N>
rd(R,D) -- define a record
rf() -- remove all record information
rf(R) -- remove record information about R
rl() -- display all record information
rl(R) -- display record information about R
rp(Term) -- display Term using the shell's record information
rr(File) -- read record information from File (wildcards allowed)
rr(F,R) -- read selected record information from file(s)
rr(F,R,O) -- read selected record information with options
** commands in module c **
bt(Pid) -- stack backtrace for a process
c(File) -- compile and load code in <File>
cd(Dir) -- change working directory
flush() -- flush any messages sent to the shell
help() -- help info
i() -- information about the system
ni() -- information about the networked system
i(X,Y,Z) -- information about pid <X,Y,Z>
l(Module) -- load or reload module
lc([File]) -- compile a list of Erlang modules
ls() -- list files in the current directory
ls(Dir) -- list files in directory <Dir>
m() -- which modules are loaded
m(Mod) -- information about module <Mod>
memory() -- memory allocation information
memory(T) -- memory allocation information of type <T>
nc(File) -- compile and load code in <File> on all nodes
nl(Module) -- load module on all nodes
pid(X,Y,Z) -- convert X,Y,Z to a Pid
pwd() -- print working directory
q() -- quit - shorthand for init:stop()
regs() -- information about registered processes
nregs() -- information about all registered processes
xm(M) -- cross reference check a module
y(File) -- generate a Yecc parser
** commands in module i (interpreter interface) **
ih() -- print help for the i module
分享到:
相关推荐
erlang编程指南学习笔记,包含具体操作命令例子
NULL 博文链接:https://jias.iteye.com/blog/615679
Joe的那篇erlang论文 Programming Erlang + 源码包 Erlang Programming Concurrent Programming in Erlang efficiecy guide 资源齐全.希望能帮到你.
erlang学习资料
erlang 程序设计一书的笔记,帮你快速重温erlang的知识点。
NULL 博文链接:https://xiajs.iteye.com/blog/1871551
erlang学习3erlang学习3erlangerlang学erlang学习3习3学习3
Erlang学习资料,2本书,不用卖书,电子书足够了
erlang学习2.pdferlang学习erlang学习2.erlang学习2.pdfpdf2.pdferlang学习2erlang学习2.pdf.pdf
本文是一篇关于Redis全套学习笔记的文章,主要介绍了Redis的基础知识、数据结构、持久化、集群、高可用、性能优化等方面的内容。通过本文的学习,读者可以全面掌握Redis的使用和应用,提高自己的技术水平和实践能力...
学习erlang 开发游戏利器 erlang学习文档 erlang学习工具
资源名称:Erlang语音学习资料汇总资源目录:【】Erlang程序设计【】[ManningPublications]ErlangandOTPinAction【】[NoStarchPress]LearnYouSomeErlangforGreatGood!ABeginner'sGuide【】[O'ReillyMedia]...
erlang学习4.pdferlang学习4.erlang学习4erlang学习4.pdf.pdfpdferlang学习4.pdf
erlang学习1.pdferlang学习erlang学erlang学习1.pdf习1.pdf1.pdf
用于erlang学习资源 一些基本的语言
erlang 连接学习例子 最简单的通讯例子
erlang入门电子书 erlang编程 Introducing Erlang,作者Simon.St.Laurent
很不错的erlang学习资料。推荐刚上手的同学下载学习。
学习erlang的好资料。 Erlang是一个结构化,动态类型编程语言,内建并行计算支持。最初是由爱立信专门为通信应用设计的,比如控制交换机或者变换协议等,因此非常适 合于构建分布式,实时软并行计算系统。 使用...