D - Module-level accessibility
- Sergey (20/20) Oct 02 2010 Hi, I'm a newcomer to D. Several days ago I've stumbled upon a very
Hi, I'm a newcomer to D. Several days ago I've stumbled upon a very
strange thing about D. As I understand, module members, such as classes,
structs, functions and variables can be marked with an accessibility
attribute, such as private, public, package or export. Say, there's a
module named "test.d":
module test;
private int x1;
public int x2;
private void fnc1()
{
}
public void fnc2()
{
}
public class C1 {}
private class C2 {}
With a great surprise, I have discovered that from another module it is
still possible to access both x1 and C1, though fnc1() is inaccessible !
Can anyone explain me what does it mean ?
Thanks in advance.
Oct 02 2010








Sergey <smsmfk gmail.com>