Functions with varying amounts of arguments?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Functions with varying amounts of arguments?

Post by Tesselode »

Is there a way to make a function have a varying number of arguments (like some of the love.graphics functions)?
User avatar
The Burrito
Party member
Posts: 153
Joined: Mon Sep 21, 2009 12:14 am
Contact:

Re: Functions with varying amounts of arguments?

Post by The Burrito »

I just put optional arguments at the end, and check if nil before doing anything with them. Not sure if theres an easy way to do more complex things like various numbers of coordinate pairs or something.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Functions with varying amounts of arguments?

Post by vrld »

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 64 guests