Hi!
I've just recently started learning Rust. Here's a few questions that
I have after writing about a hundred lines of code:
1. Why neither overloaded function, nor default values for arguments
are supported? In statically typed language overloaded functions are
quite safe and convenient. Also, from what I see, overloaded functions
could be used in various use cases instead of macros.
2. What about exceptions? Is it a design decision not to support them,
or are they planned for some future version? I understand, that
exceptions make memory management more difficult, but maybe there are
ways to restrict their usage to avoid problems (like making it
impossible to pass references as exception parameters?)
3. It seems like almost any string operation requires as_slice().
Can't various string methods be also implemented for String?
4. It looks like vectors can be concatenated with + operations, but
strings can't. Is it deliberate?
5. Simple indexing doesn't work for vectors:
let a = vec![1, 2, 3];
println!("{}", a[0]);
It's a bit surprising...
6. impl ToStr for custom struct fails:
error: conflicting implementations for trait `std::to_str::ToStr`
note: conflicting implementation in crate `std`
Is it a bug? Is Show implicitly assumed for all struct's?
7. The usage of mut is a bit confusing. It is supposed to be used as a
qualifier for a variable, but it quickly becomes a part of the type,
when you define functions like
fn test(something: &mut Something)
Maybe it makes sense move mut their? Or distinguish mut as a variable
qualifier vs const as a propery of type?
--
Thanks,
Oleg Eterevsky.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev