If you don't like macros let's try inline functions. Described here: http://www.erlang.org/doc/man/compile.html (there is section Inlining)