| ▲ | antonvs 7 hours ago | |
A language which truly treats an argument list as a tuple can support this:
…and that will have the effect of binding a, b, and c as arguments in the called function.In fact many “scripting” languages, like Javascript and Python, support something close to this using their array type. If you squint, you can see them as languages whose functions take a single argument that is equivalent to an array. At an internal implementation level this equivalence can be messy, though. Lower level languages like C and Rust tend not to support this. | ||
| ▲ | Pay08 5 hours ago | parent [-] | |
Rust definitely should. C++s std::initializer_list is a great tool and you wouldn't need macros for variadic functions anymore. | ||