[erlang-questions] custom behaviour

Dave Smith <>
Tue Feb 16 16:08:32 CET 2010


Sorry I wasn't clearer on twitter. If the behaviour is in the same
directory as the dependent modules add this to your rebar.config:

{erl_first_files, ["src/gen_gist.erl"]}.

That will ensure that gen_gist is compiled first and available in the
ebin/ path.

D.

On Tue, Feb 16, 2010 at 8:00 AM, stewart <> 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.
>
> Please help.
>
> Kind regards
> Stewart
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>


More information about the erlang-questions mailing list