[erlang-questions] is there something like #line

Vlad Dumitrescu vladdu55@REDACTED
Tue May 29 11:16:36 CEST 2007


Hi,

> Matej Kosik wrote:
> > Some languages provide mechanisms for "redefining" the current filename and line number. This is done via #line directive.
> >
> > Is there a similar directive in Erlang? I have tried to google it out, but with little luck. In `Erlang Reference Manual', section 7.2 there I see two interesting macros:
> >
> >       ?FILE.
> >           The file name of the current module.
> >       ?LINE.
> >           The current line number.

These are handled by the preprocessor in a special way, and so can't
be redefined.

The solution is to use the for example
  -file("path/to/other/file", 34).

best regards,
Vlad



More information about the erlang-questions mailing list