What's about function overloading? Something like this:
fn foo(val: int) {
io::println("int");
}
fn foo(val: str) {
io::println("str");
}
fn main() {
foo(1);
foo("test");
}
But :(
main.rs:3:0: 5:1 error: duplicate definition of foo
main.rs:3 fn foo(val: int) {
main.rs:4 io::println("int");
main.rs:5 }
As I understood, similar code can be implemented by using ifase and impl, but
it's very cumbersome way.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev