Closed glycerine closed 6 years ago
I'm working on this. Going to wrap regular Go slices in Lua full-userdata, and proxy the method calls through using a metatable on the userdata.
append works for slices in e231bee4204f805d1343e6b558e159a728a8e844
However, that's in Lua. copy
needs to write into the appropriate place in the underlying array, so for fidelity we need to use Go arrays and slices.
working for native Lua slices, as of v0.7.9.
look at using the FFI for this.
append needs to be implemented
copy needs to be implemented
The Lua table that backs slices (and will eventually back maps and structs) is implemented here https://github.com/gijit/gi/blob/master/pkg/compiler/luaUtil.go#L28
and the operations simply need to be defined in Lua.
compare to:
https://github.com/neomantra/lds : STL-like containers such as Vector and Queue (hashes and trees planned)
see also:
https://github.com/justincormack/slice