Page MenuHomePhabricator

Allow usage of underscore placeholder variable if Scribunto module 'strict' is used
Closed, DeclinedPublicFeature

Description

Feature summary:
*If the Scribunto module 'strict' (introduced in T209310) is used then no error message should be given if the (global) underscore "_" variable is used. The variable consisting of only an underscore "_" is commonly used as a placeholder when you want to ignore the variable. See of instance the Lua Style Guide at http://lua-users.org/wiki/LuaStyleGuide.

Use case(s):

  • A line like for _,v in ipairs(t) do print(v) end should be possible and should not cause an error message.

Benefits:

  • All wikis.

Event Timeline

I have no idea what this task is requesting for. For a line like for _,v in ipairs(t) do print(v) end, you are actually declare two local variables _ and v, and strict won't raise an error. If you get an error for using global underscore variable, there should be something wrong in your code.

The issue mentioned does not actually exist.