[erlang-questions] The Erlang Rationale

Edwin Fine erlang-questions_efine@REDACTED
Fri Oct 3 09:30:39 CEST 2008


Apropos of all this macro and inline stuff, I tried Richard's suggestion for
inlining but immediately hit an annoyance.

in.hrl:
-compile({inline, [{flog,3}]}).

flog(L, F, A) ->
    case iutil_log:ok_to_log(info) of
        true  ->
            iutil_log:log_info(?MODULE, L, F, A);
        false ->
            ok
    end.

logtest.erl:
-module(logtest).
-include("in.hrl").
-export([go/0]).

go() ->
    flog(?LINE, "Just logged using ~p's scheme~n", ["Richard O'Keefe"]).

$ efine@REDACTED:/tmp$ erlc logtest.erl
./logtest.erl:3: attribute 'export' after function definitions
./in.hrl:3: Warning: function flog/3 is unused
./logtest.erl:5: Warning: function go/0 is unused

Now to use this scheme, I have to ensure I put the -include AFTER all export
statements. Seems annoying. Is there another way?

E.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081003/e5297c16/attachment.htm>


More information about the erlang-questions mailing list