Created
November 11, 2012 14:51
-
-
Save nox/4055121 to your computer and use it in GitHub Desktop.
EEP37 shell example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ $ERL_TOP/bin/erl | |
Erlang R15B03 (erts-5.9.3) [source] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false] | |
Eshell V5.9.3 (abort with ^G) | |
1> F = fun Myself(N) -> | |
1> G = fun Fact(1) -> | |
1> 1; | |
1> Fact(N) when is_integer(N), N > 1 -> | |
1> N * Fact(N - 1); | |
1> Fact(_) -> | |
1> Myself | |
1> end, | |
1> G(N) | |
1> end. | |
#Fun<erl_eval.6.1798967> | |
2> F(1). | |
1 | |
3> F(4). | |
24 | |
4> F(foo). | |
#Fun<erl_eval.6.1798967> | |
5> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment