<<1:8/binary>>.
这种写法为什么报错?
(node8@erlang)33> <> = list_to_binary("abcdefgh"). <<"abcdefgh">> (node8@erlang)34> <> = list_to_binary("abcdefg"). ** exception error: no match of right hand side value <<"abcdefg">> (node8@erlang)35>
(node6@erlang)109> <<(erlang:integer_to_binary(1))/binary>>. <<"1">> (node6@erlang)110> <<(erlang:integer_to_binary(1)):8/binary>>. ** exception error: bad argument (node6@erlang)111> <<(erlang:integer_to_binary(1)):1/binary>>. <<"1">> (node6@erlang)112> <<(erlang:integer_to_binary(1)):2/binary>>. ** exception error: bad argument
(node6@erlang)116> <<1/integer>>.
<<1>>
(node6@erlang)117> <<1>>.
<<1>>
(node6@erlang)118> <<1:8>>.
<<1>>
(node6@erlang)119> <<1:83333>>.
<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,...>>
(node6@erlang)120> <<1:22>>.
<<0,0,1:6>>
(node6@erlang)121> <<1:23>>.
<<0,0,1:7>>
(node6@erlang)122> <<1:234>>.
<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,...>>
(node6@erlang)123> <<1:14>>.
<<0,1:6>>
(node6@erlang)124> <<1:145>>.
<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1:1>>
(node6@erlang)125> <<1:0>>.
<<>>
(node6@erlang)126> <<1:1>>.
<<1:1>>
(node6@erlang)127> <<1:2>>.
<<1:2>>
(node6@erlang)128> <<1:3>>.
<<1:3>>
(node6@erlang)129> <<1:4>>.
<<1:4>>
(node6@erlang)130> <<1:5>>.
<<1:5>>
(node6@erlang)131> <<1:6>>.
<<1:6>>
(node6@erlang)132> <<1:7>>.
<<1:7>>
(node6@erlang)133> <<1:8>>.
<<1>>
(node6@erlang)134> <<1:>>.
This representation is known as the abstract format. Functions dealing with such parse trees are compile:forms/[1,2] and functions in the modules epp, erl_eval, erl_lint, erl_pp, erl_parse, and io. They are also used as input and output for parse transforms (see the module compile).