Last modified: 2013-03-01 19:59:44 UTC
An #invoke call currently requires two arguments: the module name and the function to call from the table it returns. However, in some cases, modules return only one function (they have a single common "entry point") and the table is technically redundant. An example is Module:nl-verb on en.wiktionary, which exports only the function "export.conjugate" and thus all invocations will be {{#invoke:nl-verb|conjugate|...}}. It would be nice if, in this case, the module could just return a single function, and the invoke call could forego including the function name. However, this would mean that, if called with {{#invoke:foo|bar|baz}}, then within the function that Module:foo returns, frame.args[1] is now "bar" and frame.args[2] is "baz". This differs from the usual behaviour which would be to call the function "bar" and then frame.args[1] would be "baz". I don't know if that is a problem.
This would make the #invoke syntax much more confusing, and is trivial to work around. Instead of something like return function () ... end just do return { func = function() ... end } If you really want to, it is even possible to name the function with the empty string return { [''] = function() ... end } And then invoke it with {{#invoke:Module||arg1|arg2|etc}}