Skip to content

Instantly share code, notes, and snippets.

@jaytaph
Created December 31, 2012 08:10
Show Gist options
  • Save jaytaph/4418239 to your computer and use it in GitHub Desktop.
Save jaytaph/4418239 to your computer and use it in GitHub Desktop.
class foo {
public method bar(... args) {
for (i=0; i!=args.count(); i++) {
io.printf("arg %d : %s", i, args[i]);
}
}
public method baz(... args) {
self.bar(args); // This would send a list, so bar only has 1 argument
self.bar(... args); // maybe something like this, use the ... to tell that we are sending a varlist?
}
}
f = foo.new();
f.bar("hello");
f.bar("hello", "world");
f.bar("hello", "world", 12345);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment