Hi all. I have small suggestion. It would be nice if I'll able do
following thing:
struct MyStruct
{
int a, b, c;
float x, y, z;
}
struct AnotherStruct
{
mixin MyStruct;
real p, q, r;
}
I.e. in cases when a struct name is an argument for a mixin treat it as
template with no parameters. This will give some resemblance of struct
inheritance and some few another benefits.
What do you think?

I.e. in cases when a struct name is an argument for a mixin treat it as
template with no parameters. This will give some resemblance of struct
inheritance and some few another benefits.
What do you think?

Seems like kind of a niche feature (that is, a feature without much use).
We can already do:
template MyStruct_Members()
{
int x;
float y;
}
struct MyStruct
{
mixin MyStruct_Members;
}
struct MyStructInherited
{
mixin MyStruct_Members;
char[] z;
}
It's not that much more work to just make a new template.

I.e. in cases when a struct name is an argument for a mixin treat it as
template with no parameters. This will give some resemblance of struct
inheritance and some few another benefits.
What do you think?

Seems like kind of a niche feature (that is, a feature without much use).
We can already do:
template MyStruct_Members()
{
int x;
float y;
}
struct MyStruct
{
mixin MyStruct_Members;
}
struct MyStructInherited
{
mixin MyStruct_Members;
char[] z;
}
It's not that much more work to just make a new template.

Theoretically this is true. But in the reality when this isn't single
instance, structs are longer then 3 lines code became less and less
readable. This is elegant and simple to implement (I think) feature. Why
not?!
--
Victor Nakoryakov
nail-mail<at>mail<dot>ru
Krasnoznamensk, Moscow, Russia

Theoretically this is true. But in the reality when this isn't single
instance, structs are longer then 3 lines code became less and less
readable. This is elegant and simple to implement (I think) feature. Why
not?!

Well, in that case, you might as well just ask for struct inheritance. It'd
make things easier on the programmer, especially for casting.
I'd love to see struct inheritance.

Theoretically this is true. But in the reality when this isn't single
instance, structs are longer then 3 lines code became less and less
readable. This is elegant and simple to implement (I think) feature. Why
not?!

Well, in that case, you might as well just ask for struct inheritance. It'd
make things easier on the programmer, especially for casting.
I'd love to see struct inheritance.

Inheritance is too complex solution for D structs which are some kind of
scalar in D paradigm. This will raise problem with vtbls etc, etc and
structs will become classes just with another keyword to declare it like
in C++.
Mixining on the other hand has not such problems and gives ability to
emulate multiple inheritance.
--
Victor Nakoryakov
nail-mail<at>mail<dot>ru
Krasnoznamensk, Moscow, Russia

Theoretically this is true. But in the reality when this isn't single
instance, structs are longer then 3 lines code became less and less
readable. This is elegant and simple to implement (I think) feature.
Why not?!

Well, in that case, you might as well just ask for struct
inheritance. It'd make things easier on the programmer, especially
for casting.
I'd love to see struct inheritance.

Inheritance is too complex solution for D structs which are some kind of
scalar in D paradigm. This will raise problem with vtbls etc, etc and
structs will become classes just with another keyword to declare it like
in C++.
Mixining on the other hand has not such problems and gives ability to
emulate multiple inheritance.

vtbl to implement it. Inherited structure is always binary compatible
with base struct it's only extending it by new fields and/or non virtual
methods. Or may be You mean inheriting structures from interfaces?