4 ms·
have a single return value and if you really need MRV, return as a tuple type, which you could destructure. (this is what zig does)
by throwawaymaths 1y ago
have a single return value and if you really need MRV, return as a tuple type, which you could destructure.
(this is what zig does)
- 9rx 1y agoBut then why accept multiple input arguments? Why not limit to a single argument, accepting a tuple where multiple arguments are necessary, for input too? Where multiple input arguments are present, not having multiple output arguments is just strange.
- throwawaymaths 1y agoExactly. Why not make multiple argument function call syntatic sugar over a ~single argument tuple call? https://ziglang.org/documentation/0.14.1/#call https://ziglang.org/documentation/0.14.1/#call
- 9rx 1y agoWhat would you need syntax sugar for? If you are going to support multiple arguments you may as well do it properly or don't do it at all. A poor bandaid because you fucked up tuples is not a quality that is to strive for.