exclude function calls
Fri Mar 24 16:19:23 CET 2006
On Friday 24 March 2006 15:56, Yani Dzhurov wrote:
> Hi guys,
> Is it possible to exclude some particular function calls in function
> definition while compilation.
I think you should avoid compile-time determinations like these as much
as possible. Use run-time checks to see if you should do A or B
instead. With compile-time decisions you never really know what the
compiled code will do if you for example enable or disable something in
a configuration file. Was the code compiled to include functionality X,
which could therefor be enabled, or not?
Untested, but here is a way to do it at compile time :
?DOBAR andalso bar(),
or, with a function (want_to_do_bar()) that determines if bar() should
be called or not :
DoBar = want_to_do_bar(),
DoBaz andalso bar(),
You get the idea.
More information about the erlang-questions