| |
|
|
| 07 Jul 2016 04:49 AM |
No idea what those are, but okay.
-=[ RAP: 347,259 || DurstAuric; the narb of ROBLOX ]=- |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 04:54 AM |
Tuples are basically a paradigm that allows for multiple unknown arguments to be passed to a function. For example:
local function Tuple(...) local CaptureRange = {...} for i,v in next, CaptureRange do print(i,v) end end
Tuple("a", "b", "c") -> 1 a -> 2 b -> 3 c |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 04:57 AM |
Oh, in that case I knew that it was. I just didn't know the technical name for it. Thanks.
-=[ RAP: 347,257 || DurstAuric; the narb of ROBLOX ]=- |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 05:22 AM |
Those are variadic functions. Tuples are a bit different.
|
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 05:30 AM |
This is a function returning a tuple:
local function Test() return 5, "Yes", math.pi end
local A, B, C = Test()
|
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 05:37 AM |
| Hmm...interesting. I've always considered both returning multiple arguments and being able to input multiple arguments to both be called 'tuples'. I've been mistaken! Sorry for the confusion. |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 06:12 AM |
Well you are correct then, and the ... does work with tuples, but I'm just meaning that function Test(...) is not the only thing that constitutes a tuple. Specifically, it's called a variadic function. It has a lot to do with tuples though.
|
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 07 Jul 2016 07:18 AM |
| The ... is a tuple, however the specific use of declaring a function to take ... as its parameters does not inherently constitute a tuple |
|
|
| Report Abuse |
|
|