generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: This whole time I've been writing "duple" instead of "tuple"

Previous Thread :: Next Thread 
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
07 Jul 2016 04:48 AM
rip
Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
07 Jul 2016 04:49 AM
No idea what those are, but okay.


-=[ RAP: 347,259 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
MathematicalPie is not online. MathematicalPie
Joined: 19 Aug 2014
Total Posts: 28
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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
07 Jul 2016 05:22 AM
Those are variadic functions. Tuples are a bit different.


Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
MathematicalPie is not online. MathematicalPie
Joined: 19 Aug 2014
Total Posts: 28
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image