Mike McGonagle wrote:
- Lua access to PD tables
Now implemented (lacking some things, like GUI refresh).
Check the [ltabdump] and [ltabfill] examples.
Still lacking some niceness, should be able to do:
local t = pd.Table:new():sync("mytable") t[123] = 456 local x = t[789] return #t
but that's not (currently) implemented. Instead you have to do:
local t = pd.Table:new():sync("mytable") t:set(123, 456) local x = t:get(789) return t:length()
also note that Pd tables are indexed from 0, unlike Lua's 1-based indexing. I'm not sure whether to have pd.Table have 1-based indexing like Lua or stick with the Pd-style 0-based indexing (which is what is currently implemented).
Work in progress, hopefully when I polish this up a bit I'll make a pdlua-0.5 release, at which point the table API will be relatively fixed. Comments welcome.