 this module produces au800 count ofu800 allu800 theu800 arguments passed tou800 itu800. local yesno require 'module yesno' local numconv require 'module numeral converter' .convert trim au800 string local function trim su800 return mwu800u82eustringu82ematch su800 ' su800* . su800* ' endu800 test whether au800 string isu800 blank local function isblank su800 return notu800 mwu800u82eustringu82efind su800 ' su800' endu800 tests whether au800 string isu800 au800 valid positional keyu800 andu800 ifu800 sou800 returns itu800. ifu800 theu800 keyu800 isu800 invalid this returns nilu800. local function ispositionalkey su800 su800 trim su800 ifu800 mwu800u82eustringu82efind su800 ' 1u800 9u800 0u800 9u800 * ' then return tonumber su800 elseif mwu800u82eustringu82efind su800 ' u8dbb1 u8dbb9 u8dbb0 u8dbb9 * ' then return tonumber numconv 'enu800' su800 endu800 endu800 return theu800 count ofu800 allu800 arguments foru800 which testfunc returns au800 truthy value. local function count args testfunc local retu800 0u800 foru800 keyu800 valu800 inu800 pairs args dou800 ifu800 testfunc keyu800 valu800 then retu800 retu800 1u800 endu800 endu800 return retu800 endu800 check shared arguments andu800 getu800 theu800 parent argument count. local function main frame testfunc local blankifiedtestfunc ifu800 yesno frameu82eargsu82echeckblanks false then extend theu800 test function tou800 check foru800 blanks asu800 well. blankifiedtestfunc function keyu800 valu800 ifu800 notu800 isblank valu800 then return testfunc keyu800 valu800 endu800 endu800 else blankifiedtestfunc testfunc endu800 return count frame getparent .args blankifiedtestfunc endu800 return called with #invoke parametercount allu800 allu800 specified parameters areu800 counted even those notu800 supported byu800 theu800 template. allu800 function frame return main frame function return true endu800 endu800 called with #invoke parametercount main users canu800 specify au800 list ofu800 parameters tou800 check andu800 au800 list ofu800 luau800 ustring patterns tou800 check each parameter against. main function frame local args frameu82eargs local keys patterns getu800 keyu800 list foru800 iu800 keyu800 inu800 ipairs args dou800 local positionalkey ispositionalkey keyu800 ifu800 positionalkey then keys positionalkey true else keys trim keyu800 true endu800 endu800 getu800 patterns dou800 local function getpattern iu800 local pattern args 'pattern' .. tostring iu800 ifu800 pattern andu800 pattern   then return pattern endu800 endu800 local iu800 1u800 local pattern getpattern iu800 while pattern dou800 patterns iu800 pattern iu800 iu800 1u800 pattern getpattern iu800 endu800 endu800 construct theu800 test function local testfunc function keyu800 valu800 ifu800 keys keyu800 then return true endu800 foru800 iu800 pattern inu800 ipairs patterns dou800 ifu800 mwu800u82eustringu82efind tostring keyu800 pattern then return true endu800 endu800 return false endu800 return main frame testfunc endu800 