Y
Hacker News
new
|
ask
|
show
|
jobs
by
3836293648
263 days ago
Rust has exactly that. The difference is that rust considers the scope of private access te be the entire file it's defined in, not just its methods.
1 comments
kibwen
263 days ago
Just the module the struct is defined in, not the file. Easy mistake to make, given that a file is implicitly its own module, but you can create submodules within a file with the `mod` keyword.
link
3836293648
263 days ago
I thought it crossed into submodules as well, making it the entire file?
link