exclude function calls

Kostis Sagonas kostis@REDACTED
Fri Mar 24 17:41:55 CET 2006


Some things are definitely a matter of taste, but I would use
something along the following lines:

-------------------------------------------------------------
fun() ->
  foo(),
  bar(),
  baz().

-ifdef(some_macro).
bar() -> ....
-else.
bar() -> ok.
-endif
-------------------------------------------------------------

and then I would make sure I compile with +inline.


If bar/0 is a remote call, then I would do something along the
lines of

-------------------------------------------------------------
-ifdef(some_macro).
-define(BAR, mod:bar()).
-else.
-define(BAR, ok).
-endif.

fun()->
    foo(),
    ?BAR,
    baz().
-------------------------------------------------------------

Hope this helps,

Kostis




More information about the erlang-questions mailing list