escript and fun

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

escript and fun

Bengt Kleberg-3
Does funs work within escript?

Test program (could be something else wrong with it):

#!/usr/bin/env escript

-export([main/1]).

main( _X ) ->
        Fun = fun stop/0,
        Fun().

stop( ) ->
        io:format( "stop~n" ).


Output of test program:
{'init terminating in do_boot',{function_clause,[{erl_eval,expr,[{fun,6,{function,stop,0}},[{'_X',[]}],{value,#Fun<escript.2.44313615>}]},{erl_eval,exprs,4},{escript,code_handler,3},{erl_eval,local_func,4},{escript,interpret,2},{init,start_it,1},{init,start_em,1}]}}