[erlang-questions] Help - Can I stop this warning?

Tim Bates <>
Sat Sep 22 16:52:18 CEST 2007


G Bulmer wrote:
> I have been playing with this macro to print the current functions name:
> 
> -define(IOFUN(), io:format("~s: ", [case process_info(self 
> (),current_function) of {_,{_,F,_}} ->F end])).
> 
> Unfortunately, I get this irritating warning on *every* function, on  
> the first use of ?IOFUN():
> ./script.erl:34: Warning: variable 'F' exported from 'case' (line 31)
> ...
> 
> Can someone suggest how I get rid of it?

-define(IOFUN(), io:format("~s: ", [element(2, element(2, 
process_info(self(),current_function)))])).

Tim.

-- 
Tim Bates




More information about the erlang-questions mailing list