[erlang-questions] The Erlang Rationale

Ulf Wiger <>
Fri Oct 3 08:30:26 CEST 2008

2008/10/3 Richard O'Keefe <>:
> I then mentioned ?HERE as a possible idea that would leave the
> source code with a visible mention of "at this point I pass my
> source location" -- hence would be more tokens to type than
> using a macro -- but in a much shorter and potentially richer
> form than ?MODULE, ?LINE.
> Given my history of writing EEPS, readers were expected to see this
> as a pre-pre-EEP for ?HERE.  Today I've mailed out patches to add a
> prototype version of ?HERE that gives you {?MODULE,?LINE,undefined}
> with undefined as a place-holder for a future {function,arity}.

I've been using ?HERE quite often in my code. It may seem unintuitive,
but it works, since macros are simply a syntactic expansion:


-define(HERE, {?MODULE, ?LINE, undefined}).

f() ->

$ erl
Eshell V5.6.4  (abort with ^G)
1> here:f().

So no need to patch epp before one can start using it.

It's possible to add to the macro a way to find out the current
module and arity as well.

In a previous thread:


Then we could make our HERE definition:


Ulf W

More information about the erlang-questions mailing list