, , , . "", , , :
-module(err).
-export([test/0]).
test() ->
"ok\n" = io:get_line("an input ? ").
test2() ->
F = fun() ->
"ok\n" = io:get_line("an input ? ")
end,
F().
:
1> c(err).
{ok,err}
2> err:test().
an input ? ok
"ok\n"
3> err:test().
an input ? ko
** exception error: no match of right hand side value "ko\n"
in function err:test/0 (err.erl, line 6)
4> F = fun() -> a = 10 end.
5> F().
** exception error: no match of right hand side value 10
6> err:test2().
an input ? ok
"ok\n"
7> err:test2().
an input ? ko
** exception error: no match of right hand side value "ko\n"
in function err:'-test2/0-fun-0-'/0 (err.erl, line 10)
8>