
Eshell V12.2.1 (abort with ^G) 1> A1=[1,2,3]. [1,2,3] 2> io:format("~p~n", A1). ** exception error: bad argument in function io:format/2 called as io:format("~p~n",[1,2,3]) *** argument 1: wrong number of arguments 3> A2=[[1,2,3]]. [[1,2,3]] 4> io:format("~p~n", A2). [1,2,3] ok 5> 难道 io:format 直接打印变量参数的话,需要变量是嵌套列表?求老司机解惑为什么要这样设计(本人 erlang 新手)。
如果直接在调用 io:format 的时候,给参数传递一个列表参数的表达式也就不会报错。
https://stackoverflow.com/questions/2523250/erlang-ioformat-and-a-hanging-web-application 这里我 google 到的一个疑问解答,但还是有些不明白 io:format 调用的时候,传递变量参数和列表表达式的区别。
]]>但 OTP 相关的资料却非常少。
比如存储,关于 ETS 的实现几乎找不到,但同类型的 Redis,却有一大把。
而且 ETS 要比 Redis 有趣的多,ETS 可以充分利用多核资源,而 Redis 是单线程的。
这对想了解 OTP 的人,是一件很遗憾的事。
所以开了这个 awesome-otp-learning 这个 repo,用来收集 OTP 内部实现相关的资料。
希望可以抛砖引玉。
]]>《 erlang 程序设计》和《 otp 并发编程》都要过两边以上。 记录学习笔记。 写一个小项目,rpc 或者 web 框架的。 ]]>现在使用asdf工具加又拍云镜像可以达到>1M 的下载速度,做到了一键快速安装 Erlang。
$ asdf install erlang 20.0 Downloading OTP-20.0.tar.gz to /Users/zhongwen/.asdf/plugins/erlang/kerl-home/archives % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 120 0 120 0 0 101 0 --:--:-- 0:00:01 --:--:-- 101 100 50.3M 100 50.3M 0 0 1345k 0 0:00:38 0:00:38 --:--:-- 2512k ]]>域名很早注册了,昨晚刚搭建。
erlanger们呢?
]]>