Since it's invalid to put storage class stuff on the end (actual type
must be on the end), then I would mandate that storage class stuff
should go at the start, not randomly in the middle somewhere, ie: storage_class type_constructor actual_type
If it were up to me, I would mandate this in the spec, but failing that, at least proliferate this by general policy; I think this helps non-D coders to osmose this complexity without a detailed conversation... and for everyone else, the code just reads more consistently.
I see a surprising number of people writing `const ref T`, and I suspect that people are writing it holding the same kind of conceptual confusion that a lot of new users have expressed to me. As I see it, the fact people tend to write this at all is clear evidence that we shouldn't allow it!
Similarly, allowing attributes on functions should likewise appear after the function prototype:
struct S {
const(T) method();
const T method(); // not the same; synonym for `T method() const`
}
This kind of confusion is just totally unnecessary. Any non-expert reader would assume they are the same. There's no value in inviting this confusion.
Since it's invalid to put storage class stuff on the end (actual type must be on the end), then I would mandate that storage class stuff should go at the start, not randomly in the middle somewhere, ie: storage_class type_constructor actual_type
If it were up to me, I would mandate this in the spec, but failing that, at least proliferate this by general policy; I think this helps non-D coders to osmose this complexity without a detailed conversation... and for everyone else, the code just reads more consistently.
I see a surprising number of people writing `const ref T`, and I suspect that people are writing it holding the same kind of conceptual confusion that a lot of new users have expressed to me. As I see it, the fact people tend to write this at all is clear evidence that we shouldn't allow it!
Similarly, allowing attributes on functions should likewise appear after the function prototype: