[erlang-questions] OTP version in a built in constant

Motiejus Jakštys desired.mta@REDACTED
Mon Jun 11 19:30:52 CEST 2012


Hi,

I am writing some code which is supposed to run on R13-R15. For
behaviors I would really like to use this:
-callback my_fun() -> {oh, cool}.

However, this is invalid syntax in <R15B. This works for older Erlangs:

-ifdef(new_enough_erlang).
-callback my_fun() -> {oh, cool}.
-else
behaviour_info(callbacks) -> [{my_fun, 0}].
-endif.

What should I replace -ifdef ... -endif with? In other words, is there
a built-in constant which has OTP version defined?

-- 
Motiejus Jakštys



More information about the erlang-questions mailing list