[erlang-questions] How to get the line number of current executable code?

Andras Georgy Bekes <>
Mon Aug 18 16:00:35 CEST 2008

> -define(FUNCTION, hd(element(2,element(2,catch erlang:error([]))))).
A safer solution (it has no side effects, unlike the above):


I don't know if it's more expensive or not, but if it does matter, 
you're doing something wrong.


More information about the erlang-questions mailing list