Maybe this is a stupid question, but why aren't we able to send nested tables over channels? Is it impossible or very hard to make?
Is there a solution to send nested tables over channels? Serializing? Repeated channel sends?
Either repeated channel sends or serializing; I personally chose the former. I basically send a number (the number of tables the table contains) followed by each table sent separately.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
It's a trade-off. Full duplication is error-prone, more expensive, and often overkill. If you do want to send nested tables, you can use any kind of serialization that suits your situation. Serialization code that only supports tables without cyclic references can be much simpler and faster than code that does have to support those, for instance.
bartbes wrote:Serialization code that only supports tables without cyclic references can be much simpler and faster than code that does have to support those, for instance.
What are cyclic references? A table referencing itself? Is that even possible in lua?
Dantevg wrote:Something related: Why do all the channel functions accept flat tables, but the channel.peek() function doesn't?
Even if the wiki page states this, did you try it yourself? I mean, logically, it should also support them. And if it does, then the article needs to be fixed, it's that simple.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.