escript and fun

Bengt Kleberg <>
Thu May 10 07:41:39 CEST 2001


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}]}}



More information about the erlang-questions mailing list