Module talk:Wd/Archive 1: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Wd) (bot
m Replaced deprecated <source> tags with <syntaxhighlight> (via WP:JWB)
Line 378:
== Use of underscore ==
 
Use of undersore (<sourcesyntaxhighlight lang="lua" inline>local _ = Config.new()</sourcesyntaxhighlight>) as a variable name breaks several tools for Lua, as it is assumed to be used for unassigned values. Or breaks, some of them silently fails as statements involving an underscore are simply neglected. (Not sure if complete code paths involving a neglected statement are neglected.) [[User:Jeblad|Jeblad]] ([[User talk:Jeblad|talk]]) 01:24, 6 November 2019 (UTC)
:{{ping|Jeblad}} The underscore is currently used in a very limited and controlled way, within a local scope. It's not used with Lua tools, so I don't think there is an issue really. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]]&nbsp;[[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 21:25, 11 November 2019 (UTC)
::Yes, but it is true that Lua convention is to use underscore to mean an unused variable. The code in the module is very clean and sophisticated but I was going to suggest that the global variables be cleaned up. I'll post a list and have a look at that later if wanted. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 23:31, 11 November 2019 (UTC)