https://bugzilla.wikimedia.org/show_bug.cgi?id=45562

       Web browser: ---
            Bug ID: 45562
           Summary: Allow modules to return a single function rather than
                    a table
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: Unprioritized
         Component: Scribunto
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to