[erlang-questions] ?DATE and ?TIME MACROs

Richard Carlsson richardc@REDACTED
Wed Oct 8 08:41:51 CEST 2008

harry wrote:
> How would you do ?DATE and ?TIME (apart from erlc -DDATE=`time` ....
> or something similar, which is *nix specific)
> Would there be any mileage in adding these (and ?FUNCTION) to epp?

DATE and TIME could easily be added to epp, as long as one can still
override the definitions from the command line with -D to set a global
time and date for the entire build.

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. In that
case you might as well use that function call instead of the macro.


More information about the erlang-questions mailing list