Varargs!
Displaying 1-5 of 5 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
mcgrue

Hey guys!

Did you know Overkill added Variable Arguments to v3? Like a year ago or something?

And then didn't document them?

Well, now you do. ;)

Edit:
CallFunction() updated.
Varargs explained!
String-calling explained!

You may all now praise Overkill instead of mocking him. Maybe.

Posted on 2008-12-26 23:41:09 (last edited on 2008-12-27 00:38:29)

ErayMan

Oh cool! Very cool.
I wish I had this back when I coded my battle engine. t'would have made things much cleaner. :)
Thanks Overkill! (And Grue, for doin' the dirty job of commenting!)

Posted on 2008-12-28 21:33:16

Overkill

Ahem. Actually I commented! :D

Posted on 2008-12-28 22:59:22

creek23

Update to CallFunction, I think, it the best one.

Though, it was not commented (or it was -- was it? :P), I think it has been discussed before. And I know, there was this feature being added.

I just don't know if "my"+"function"(), is such a great idea, tho. :-)

Posted on 2008-12-30 05:14:05

Overkill

Well, no, probably not, but it seems more fair (and sane compiler-wise) to allow the syntax sugar for any string expression rather than only for select kinds of strings. And who knows, maybe somebody has some sort of convention planned for their code, like _____Render() + ______Update().

int SpriteCreate(string typename)
{
// MISSING CODE FOR FINDING HANDLES.
// Whatever, I'm trying to show a point.
sprite[i].typename = typename;
return i;
}

void SpriteUpdate(int i)
{
sprite[i].typename + "Update"(i);
}

void SpriteRender(int i)
{
sprite[i].typename + "Render"(i);
}


I feel it's more important to give flexibility to people even if it means "ugly code" could be written by some people.

Posted on 2008-12-30 10:27:39 (last edited on 2008-12-30 10:28:38)


Displaying 1-5 of 5 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.