For me, in the D language, one of the key features of the language is the ability to use internal classes (although I would also like to have internal structures)
However, writing extra nesting levels (class in class) does not look attractive (especially if there is more than one nesting level).
In this regard, I would like to have the ability to have an alternative syntax for writing
internal and possibly nested classes and structures,
for textual alignment of them in a line (getting rid of nesting).
The proposed syntax for internal classes:
class A; //outer
{
fields;
...
class B; //inner prototype
}
class A.B //inner
{
fields;
...
class C; // 2-th inner prototype
class D;
}
class A.B.C
{
fields;
...
}
class A.B.D
{
fields;
...
}
Well, to avoid getting up twice, a similar mechanism can be implemented for nested functions:
type f(type var)
{
instructions;
type g(type var); // nested prototype
}
type f.g(type var)
{
instructions;
}
Naturally, the scopes for these nested definitions are limited to modules.