This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Kilobyte's profile picture

Tables in peripheral argument lists

Started by Kilobyte, 22 April 2013 - 08:09 PM
Kilobyte #1
Posted 22 April 2013 - 10:09 PM
Hello together,

i just realized that you can't pass tables to peripheral functions. i am now requesting this to be added for multiple reasons:
  1. Its unexpected behaviour to not to allow tables
  2. If you got arbritrary data, having an argument list is much less convenient to use and makes it unecessarily confusing.
  3. We can also return tables or pass them as event args, so why not accept them as args?
Would really apreciate to get this added

Greetz, Kilobyte
Cloudy #2
Posted 22 April 2013 - 10:29 PM
Already planned.
Left4Cake #3
Posted 23 April 2013 - 07:28 AM
Already planned.

Sweet!

The only work around I can think of is having the table saved to a file and passing the file location as an arg, but that's more work on the server.
Bubba #4
Posted 23 April 2013 - 10:40 AM
Sweet!

The only work around I can think of is having the table saved to a file and passing the file location as an arg, but that's more work on the server.

Or just use unpack.
Kingdaro #5
Posted 23 April 2013 - 11:13 AM
What exactly is OP asking for?
Espen #6
Posted 23 April 2013 - 11:27 AM
What exactly is OP asking for?
He's talking about peripherals, i.e. it has more to do with the Java-side of CC than the Lua-side.
Since Lua and Java use different data types, they have to be converted if they are being passed between a CC computer and a peripheral.
At the moment the peripheral API (Java-side API) doesn't allow you to directly pass a Lua table from a CC computer into a Java peripheral.
Lyqyd #7
Posted 23 April 2013 - 12:21 PM
If this is changed, does that imply that tables will become usable in manually-queued event parameters, or is passing the table to the Java not the biggest issue there?