On 5/29/13 2:18 PM, Gábor Lehel wrote:
Hello list,
Currently Rust has different default visibilities in different places:
- `mod` items are private
- `struct` fields and `enum` variants are public
- `trait` methods are public
- `impl` methods are private
- `impls for` are public (by necessity)
This isn't quite accurate. Actually, struct fields, enum variants, and
trait methods are public if and only if the struct/enum/trait they're
contained within are public. This is basically equivalent to the above,
but is a more consistent formulation of the rule.
- Most definitions are written to be public. Writing `public` in front
of every dang thing was annoying in Java and C#, and it's no less
annoying in Rust. Maybe especially so for those coming from C/C++, who
haven't already resigned themselves to it.
I have a lot of sympathy for this, mainly because I personally don't
like the look of the word `pub` and don't like seeing it everywhere :)
Also your points about it being easier to remember are valid and
well-taken. But I worry about people making too many symbols public for
this reason. Also it would be a large change at this stage.
Overall I think I'm neutral/conflicted on this proposal.
Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev