[erlang-questions] custom behaviour
Steve Vinoski
vinoski@REDACTED
Tue Feb 16 16:08:52 CET 2010
On Tue, Feb 16, 2010 at 10:00 AM, stewart <setori88@REDACTED> wrote:
> Dear all
>
> I would like to create a custom erlang behaviour
>
> ------------------ gen_gist.erl ---------------
> -module(gen_gist).
>
> -export([behaviour_info/1]).
>
> behaviour_info(callbacks) ->
> [{foo,0}];
> behaviour_info(_Other) ->
> undefined.
>
> -----------------end gen_gist.erl -------------
>
> ----------------- rtree.erl -------------------
> -module(rtree).
> -behaviour(gen_gist).
>
> -export([foo/0]).
>
> foo() ->
> ok.
> ---------------- end rtree.erl ---------------
> now when i run (rebar) i get :
> "src/rtree.erl:2: Warning: behaviour gen_gist undefined"
>
> I have tried doing "erlc rtree.erl -pa ." but still to no avail.
>
You're almost on the right path, no pun intended. :-) Your -pa option needs
to point to where the beam file for the gen_gist behavior is located, not to
where the source file is located.
--steve
More information about the erlang-questions
mailing list