这是一篇水文

-----------------------------------------------------

很好用的一个技巧

http://www.erlang.org/doc/man/shell_default.html

http://www.cnblogs.com/me-sa/archive/2012/03/04/erlang0043.html

https://gist.github.com/wardbekker/1300812

http://inaka.net/blog/2012/12/03/some-erlang-magic/

还有一个小技巧,

在shell 中加载头文件中的头文件, 可以使用rr/1, 也可以这样做:

1 redink:src redink$ ls
2 lproto.app.src        lproto.erl        proto            simple.proto        user_default.erl
3 redink:src redink$ cat user_default.erl 
4 -module(user_default).
5 -include("simple_pb.hrl").
6 redink:src redink$ ls ../include/
7 simple_pb.hrl

这样在shell 中就不需要再使用rr/1 来加载了

Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Eshell V6.3  (abort with ^G)
1> #person{name = <<"redink">>, address = <<"beijing">>, phone_number = 12, age = 5}.
#person{name = <<"redink">>,address = <<"beijing">>,
        phone_number = 12,age = 5,location = undefined}

看起来非常方便. 

posted on 2015-05-26 11:40  _00  阅读(843)  评论(0编辑  收藏  举报