Skip to content

Instantly share code, notes, and snippets.

@hansihe
Created February 5, 2018 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hansihe/c4d69d698ac133aeee96cfd95ca96216 to your computer and use it in GitHub Desktop.
Save hansihe/c4d69d698ac133aeee96cfd95ca96216 to your computer and use it in GitHub Desktop.
module 'test' ['add'/2,
'add_two'/3,
'module_info'/0,
'module_info'/1,
'return_closure'/1]
attributes [%% Line 1
'file' =
%% Line 1
[{[116|[101|[115|[116|[46|[101|[114|[108]]]]]]]],1}]]
'add'/2 =
%% Line 4
fun (_@c1,_@c0) ->
%% Line 5
call 'erlang':'+'
(_@c1, _@c0)
'add_two'/3 =
%% Line 7
fun (_@c2,_@c1,_@c0) ->
let <I> =
apply %% Line 8
'add'/2
(_@c2, _@c1)
in %% Line 9
apply 'add'/2
(I, _@c0)
'return_closure'/1 =
%% Line 11
fun (_@c0) ->
%% Line 12
( fun (_@c1) ->
%% Line 13
apply 'add'/2
(_@c0, _@c1)
-| [{'id',{0,0,'-return_closure/1-fun-0-'}}] )
'module_info'/0 =
fun () ->
call 'erlang':'get_module_info'
('test')
'module_info'/1 =
fun (_@c0) ->
call 'erlang':'get_module_info'
('test', _@c0)
end
-module(test).
-export([add/2, add_two/3, return_closure/1]).
add(A, B) ->
A + B.
add_two(A, B, C) ->
I = add(A, B),
add(I, C).
return_closure(I) ->
fun(A) ->
add(I, A)
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment