Yes but it is painful. Below is a "lambda function declaration" (aka fun
in Erlang terms).
1> F=fun(X) -> X+2 end.
%%? #Fun <erl_eval.6.13229925>
Have a look at this post. You can even enter a module's worth of declaration if you ever needed. In other words, yes you can declare functions.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…