Content deleted Content added
→boolean: on is ok |
→boolean: nothing's easy |
||
Line 117:
The function boolean is wrong. It should return either "false" or "true", never nil. nil is not a boolean value. The input parameter called "text" can be a numerical value too, so is named wrong. No need to bend meanings. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 14:10, 20 September 2013 (UTC)
:Option value should be "on" just as other such params have. No need to introduce "yes", "y", "1" as option value. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 14:24, 20 September 2013 (UTC)
::It's true that my boolean function is self-indulgent as I have had to implement similar stuff on different systems where all the possible "true" values are required, however, it's perfectly valid Lua. The parameter is called "text" because it can only be a string, not numeric (it's not intended to be used from other modules where arbitrary parameters could be passed). Also, it's conventional Lua to not return anything for false, although I do feel unclean after doing that, and my more recent functions have tended to always return a value. I'll try to look around some other templates/modules to gauge what boolean option values are generally used, but we're talking about a pretty minor issue that isn't even used currently. One issue about only regarding "on" as true is error reporting—should the module report an error if the invoking template contains "warnings = yes"? [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 00:16, 21 September 2013 (UTC)
== Before going live ==
|