Jump to content




Tables in peripheral argument lists


  • You cannot reply to this topic
6 replies to this topic

#1 Kilobyte

  • Members
  • 122 posts

Posted 22 April 2013 - 09: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:
  • Its unexpected behaviour to not to allow tables
  • If you got arbritrary data, having an argument list is much less convenient to use and makes it unecessarily confusing.
  • 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

#2 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 22 April 2013 - 09:29 PM

Already planned.

#3 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 23 April 2013 - 06:28 AM

View PostCloudy, on 22 April 2013 - 09:29 PM, said:

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.

#4 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 23 April 2013 - 09:40 AM

View PostLeft4Cake, on 23 April 2013 - 06:28 AM, said:

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.

#5 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 23 April 2013 - 10:13 AM

What exactly is OP asking for?

#6 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 23 April 2013 - 10:27 AM

View PostKingdaro, on 23 April 2013 - 10:13 AM, said:

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.

#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 23 April 2013 - 11:21 AM

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?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users