Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created January 15, 2011 18:07
Show Gist options
  • Save josevalim/781101 to your computer and use it in GitHub Desktop.
Save josevalim/781101 to your computer and use it in GitHub Desktop.
Tree = {function,1,foo,1,
[{clause,1,
[{var,1,self}],
[],
[{op,1,'+',{integer,1,1},{integer,1,2}}]}]}.
% Thanks to N_Ox on #erlang for pointing erl_syntax:abstract out.
{value, Tree, _ } = erl_eval:expr(erl_syntax:revert(erl_syntax:abstract(Tree), [])).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment