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

Mats Cronqvist mats.cronqvist@REDACTED
Mon Aug 25 08:57:44 CEST 2008


Ulf Wiger wrote:
> I should perhaps bring special notation to the smiley at the
> end of my message. (:
>
> Whether or not the solution is cool is surely a matter of
> taste - but I believe that the one who first came up with it
> was Mats Cronqvist, the champion of obfuscated Erlang
> code. (:
>   
  thanks for the endorsement...

  for the record, i have since moved on to using this:
-define(position,[process_info(self(),current_function),{line,?LINE}]).

  sometimes adding this:
proplists:lookup(source,?MODULE:module_info(compile)).

  mats



More information about the erlang-questions mailing list