The problem is that Erlang functions are uniquely identified by Name/Arity
; io:format/1
and io:format/2
, for instance, are two different functions. Hence, variadic functions simply don't fit into Erlang.
The cleanest solution is probably what you suggested. Another option is to write a custom parse transform (a module that rewrites the AST after parsing but before compilation) to catch and transform calls to the specific functions you want, letting others pass through unmolested. The transform could intercept calls like pipe(A1, A2, A3, ..., An)
and rewrite them to pipe([A1, A2, A3, ..., An])
.
Be warned though: Parse transforms can be difficult to get right, and they must be explicitly referenced in every module that needs to use the features they provide. An example of parse transforms put to good use is Basho's Lager logging library.