Hi John,

There is nothing preventing you from writing functions that take one tuple parameter instead of multiple parameters. If you're faced with library routines with signatures that aren't to your liking, it's simple to write macros that tuple, untuple, curry, or uncurry parameters.

For example, take the function map, which has the type fn[T,U](fn(&T) -> U, vec[mutable? T]) -> vec[mutable? U]. If you would prefer that it had the type fn[T,U](tup(fn(&T) -> U), vec[mutable? T])) -> vec[mutable? U] instead, then you could define a macro #tuple so that you could say #tuple(map) to get the version of "map" with the signature you prefer.

Incidentally, I would be careful with the OCaml comparison; OCaml has functions that take multiple, untupled parameters via the named and optional parameters feature.

Finally, there's no need for the hyperbolic "[Rust's type system] isn't a type system at all" kind of language. Of course Rust has a type system. Unless you have found a way in which Rust's type system is unsound (which we would definitely like to hear about if so!), that is beyond debate.

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to