Created
August 26, 2016 10:30
-
-
Save voluntas/288a776b11c332062a7091d0fbfbd190 to your computer and use it in GitHub Desktop.
This file contains 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
Eshell V8.0.3 (abort with ^G) | |
1> erl_scan:string("fun() -> ok end."). | |
{ok,[{'fun',1}, | |
{'(',1}, | |
{')',1}, | |
{'->',1}, | |
{atom,1,ok}, | |
{'end',1}, | |
{dot,1}], | |
1} | |
2> {ok, Tokens, _} = erl_scan:string("fun() -> ok end."). | |
{ok,[{'fun',1}, | |
{'(',1}, | |
{')',1}, | |
{'->',1}, | |
{atom,1,ok}, | |
{'end',1}, | |
{dot,1}], | |
1} | |
3> {ok,[Expression]} = erl_parse:parse_exprs(Tokens). | |
{ok,[{'fun',1,{clauses,[{clause,1,[],[],[{atom,1,ok}]}]}}]} | |
4> erl_eval:expr(Expression,erl_eval:bindings(erl_eval:new_bindings())). | |
{value,#Fun<erl_eval.20.52032458>,[]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment