Celtic Minstrel
e1300e29b0
Lua API: Add inline documentation for pretty much everything and convert existing docs ( #6483 )
...
The new format is EmmyLua-based and can be used with (at least) Visual Studio Code.
2022-02-17 13:43:31 -05:00
Luther
bff219d41f
Expand the reduce function to both fold and reduce ( #6337 )
2021-12-04 17:46:12 -05:00
Pentarctagon
370d03ccb7
Fix luacheck warnings and add to CI.
...
Note the `exclude_files` in .luacheckrc should be deleted once the eventual Ubuntu 22.04 base image has an updated luacheck that supports lua 5.4.
2021-11-28 14:26:02 -06:00
Celtic Minstrel
e9465fa03e
Lua API: Add alternative version of map function to be used on arrays
2021-09-04 22:20:28 -04:00
Celtic Minstrel
b22c3b595c
Lua API: Fix functional.map returning the wrong answer if used on a table that contains numeric keys but is not strictly an array
2021-09-04 22:20:28 -04:00
Celtic Minstrel
440dbbd0ad
Lua API: The value function is now optional in functional.choose[_map]
...
By default, the functions now use the value taken directly from the map or array.
In addition, if a string or other non-functional value is passed, it's used as a key on the value.
2021-09-04 22:20:28 -04:00
Celtic Minstrel
29e11e7914
Lua functional library: make reduce accept an operator name in place of a function, add zip
2019-12-07 13:52:49 -05:00
Vasya
fa71ab4be0
Lua API: simplify functional.reduce ( #2788 )
...
simplify code and remove `indentity or 0` VS `indentity` inconsistency.
(cherry-picked from commit 2b8782923a758eee2e167e5c4097f2803e6e2be6)
2018-10-07 03:18:38 +00:00
Celtic Minstrel
f6c04e7dd1
Add functional.lua which implements higher-order functions
...
This covers all the main higher-order functions included in WFL, except zip.
The two already implemented in ai_helper have been replaced with redirection stubs.
2017-05-10 17:40:20 -04:00