[erlang-questions] ?DATE and ?TIME MACROs
Richard O'Keefe
ok@REDACTED
Thu Oct 9 04:28:07 CEST 2008
On 8 Oct 2008, at 7:41 pm, Richard Carlsson wrote:
> FUNCTION, however, does not really belong in the preprocessor, because
> it can never be expanded at preprocessing time to a literal (so that
> you
> can e.g. use it in a pattern); it must expand to a runtime call
It can't be expanded at preprocessing time to a literal, true.
But it CAN be expanded at preprocessing time to a
{location,Line_Number,function}
token which the *parser* can expand to a literal (so that you can
for example use it in a pattern). (Actually, with a bit more work,
the preprocessor *could* do that part as well, but this would mean
repeating work already done by the parser, so I wouldn't do it that
way.)
More information about the erlang-questions
mailing list