Surfaced when the dev shell was pinned to Lua 5.1 (the pslua target); the fork previously tested on Lua 5.3, which hid this.
src/Control/Extend.lua arrayExtend used f(table.unpack(xs, i+1)):
table.unpack does not exist in Lua 5.1 (it is unpack in 5.1, table.unpack from 5.2) → runtime nil-call on the 5.1 target.
- It also spread the tail as varargs and was off-by-one, whereas
extend :: (Array a -> b) -> Array a -> Array b takes a single Array argument.
Fix: build the suffix sub-array with an explicit loop (no unpack) and pass it as one Array. Also the FFI value needed the paren-wrapped (function ... end) shape the pslua linker accepts.
Fixed together with the Lua-5.1 pin in the tooling-alignment PR #1 (the fix is coupled: CI cannot go green under 5.1 without it).
Surfaced when the dev shell was pinned to Lua 5.1 (the pslua target); the fork previously tested on Lua 5.3, which hid this.
src/Control/Extend.luaarrayExtendusedf(table.unpack(xs, i+1)):table.unpackdoes not exist in Lua 5.1 (it isunpackin 5.1,table.unpackfrom 5.2) → runtime nil-call on the 5.1 target.extend :: (Array a -> b) -> Array a -> Array btakes a single Array argument.Fix: build the suffix sub-array with an explicit loop (no unpack) and pass it as one Array. Also the FFI value needed the paren-wrapped
(function ... end)shape the pslua linker accepts.Fixed together with the Lua-5.1 pin in the tooling-alignment PR #1 (the fix is coupled: CI cannot go green under 5.1 without it).