Conversation started Jun 16, 2023 at 20:58.
Jun 16, 2023 20:58
Does Rust have any sort of splat/spread?
E.g., if I have a function a that returns a tuple of two items, and a function b that takes two arguments, is there a better way to call b with a's outputs than let (c, d) = a(); b(c, d)?
(IMO the syntax for that should be b a(), and we should treat (f(...) as f taking a tuple as its arguments, which is destructured by the function definition f(...) = ...)
(not for Rust ofc)
(just like, in general)
That also makes names arguments more legit, since you'd do something like tcp_bind { addr: "127.0.0.1", port: 8080 }...passing a (what's the term? it's two words, from latin I think?) struct to the function
ad hoc
And for readability purposes you could require that the argument to a function is either a tuple, ad hoc struct, or array
Or maybe even a string literal...like JS template strings
split_words"this is a string"
Oh I suppose I should go on these sorts of tangents in the Garbage Collector now
 
Conversation ended Jun 16, 2023 at 21:07.