勉強中2

77> F = fun(X, Y) -> X + Y end.
#Fun<erl_eval.12.113037538>
78> F(1, 2).
3

関数はファーストクラスのオブジェクト。

79> X = io.
io
80> X:format("hoge~n").
hoge
ok

モジュールもファーストクラスのオブジェクトのようにみえる。実際にはアトムだが。

81> Y = X:format.
* 1: illegal expression

あれー。これはできないのかなぁー。

http://erlang.org/doc/man/erlang.html#apply-2

82> Y = format.
format
83> apply(X, Y, ["hoge~n"]).
hoge
ok

ちょっとださいけど一応できる。