[erlang-questions] Somebody please correct my -callback understanding
Daniel Luna
daniel@REDACTED
Wed Dec 14 19:38:33 CET 2011
2011/12/14 Damian Dobroczyński <qoocku@REDACTED>:
> Wow, It's a miracle! I've just found the answer and (what I understand)
> a bug. IT IS "-behavior (...)" which is perfectly understood by the
> compiler but not by by the dialyzer! Dialyzer expects "-behaviour (...)"
> (note the different spelling).
This is not a bug. Erlang has always used 'behaviour' (and
'behaviour_info'). See
http://en.wikipedia.org/wiki/American_and_British_English_spelling_differences#-our.2C_-or
As a side note, Erlang allows for any user defined elements starting with -.
If you for example add the following line to your code
-my_own_local_thing(whatever_data).
then this is fully legal Erlang, and its effect is seen if you run
Module:module_info()
[...
{attributes,[{behaviour,[supervisor]},
{my_own_local_thing,[whatever_data]}]},
...]
Cheers,
Daniel
More information about the erlang-questions
mailing list