I'd like to be able to define a function which accepts a variable (within a known range) number of arguments, to be used like this:
foo(1, 2)
foo(1, 2, 3, 4)
I can think of 2 possible ways I might want to be able to define it, default argument values or multiple definitions. For my use case either one will work, though I think multiple definitions is the better one (and it can emulate default values pretty trivially)
I'd like to be able to define a function which accepts a variable (within a known range) number of arguments, to be used like this:
I can think of 2 possible ways I might want to be able to define it, default argument values or multiple definitions. For my use case either one will work, though I think multiple definitions is the better one (and it can emulate default values pretty trivially)