Erlang 笔记

1.不能够声明指定类型的变量,变量的类型是在运行时确定的

2.The scope of an Erlang Variable is limited to the function it is declared in.

3.No global state

4.Summary of less painfull loops

if you need to perform an action for each element in a list (returning no value) use lists:foreach

if you need to compute a value for each element in a list use list:map

if you need to accumulate a value for each element in a list use lists:foldl or lists:foldr

5.,表示语句块中语句之间的间隔,

   ;表示后面还有候选分支

   .表示函数结束

6.if the erlang philosophy towards errors could be summarized in a slogan,it would be "Let it fail"

7.-include_lib 会忽略应用的版本号

8.“http://” ++ Rest = “http://www.erlang.org” Rest值为"www.erlang.org",习惯用法

9.

-define(Value(call),io:format("~p=~p~n",[??call,call])).

test()->?Value(length([1,2,3])).

>macros1:test().

"length([1,2,3])"=3

 

10.

It is important to order the alternatives properly.Erlang will stop at the first match it finds,so make sure you order the alternatives from most restrictive to least restrictive.

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值