Funs behaving differently after native compilation

Joel Reymont joelr1@REDACTED
Thu Jan 12 17:00:00 CET 2006


Folks,

My funs seem to behave differently when the beams are compiled to  
native code.

Is there an explanation to this? I am passing indeed passing funs as  
{M, F} and then calling them as per the code below.

Why does it work when the code is byte-compiled and how do I work  
around these errors?

monitor(self(), Sock, {gen_udp, close})

monitor(Sock, Closer) ->
     receive
	{'DOWN', _, process, _, _} ->
	    Closer(Sock);
	Any ->
	    io:format("Monitor: Unknown:~n~p~n", [Any]),
	    monitor(sock, Closer)
     end.

My make file:

{'*',[native]}.

The errors that I get when my code is compiled to native:

=ERROR REPORT==== 12-Jan-2006::15:42:25 ===
Error in process <0.31.0> with exit value: {{'EXIT',{{badfun, 
{randomplay,script}},[]}},[]}

=ERROR REPORT==== 12-Jan-2006::15:42:26 ===
Error in process <0.30.0> with exit value: {{'EXIT',{{badfun, 
{lobbybot,script}},[]}},[]}

=ERROR REPORT==== 12-Jan-2006::15:42:26 ===
Error in process <0.32.0> with exit value: {{badfun,{gen_udp,close}},[]}

	Thanks, Joel

--
http://wagerlabs.com/




More information about the erlang-questions mailing list