Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 10 06:42:14 PDT 2014


On 10/9/14 10:37 PM, Walter Bright wrote:

> For functions, const-as-storage-class applies to the function symbol.
> And if it is misused, the compiler will very likely complain about a
> mismatched type.

Can you demonstrate this? I hate to see D reject a unanimously wanted 
improvement on something that is "likely" but not defined.

> Breaking this adds a special case inconsistency, besides breaking
> existing code.

Just like if(x); is rejected inconsistently. The point is, it's WORTH 
having the inconsistency to avoid the issues that come with it.

> (I understand that there's a lot of advocacy lately about "break my
> code", but I'm the one who bears the brunt of "you guys broke my code
> again, even though the code was correct and worked perfectly well! D
> sux.", besides, of course, those poor souls who have to go fix their
> code base, and I hear again about how D is unstable, another Reddit
> flame-fest about D being unsuitable because the designers can't make up
> their mind, etc.)

You need to grow a thicker skin on Reddit I think.

> This endless search for the ideal syntax is consuming our time while we
> aren't working on issues that matter. (And this change will consume
> users' time, too, not just ours.)

This is not a new problem, not a crazy novel syntax, and the time 
consumed is already taken (PR already exists). Every time I turn around, 
someone on D is complaining that "we" shouldn't spend time doing this or 
that. But "we" are all volunteers, and while it's nice to have 
direction, if someone wants to work on something, I don't want to say 
"you can't do that, please work on X instead." It doesn't help, it 
doesn't motivate.

Really, what you are saying here is, the unanimous opinion of the 
die-hard very dedicated D community is worthless compared to the opinion 
of a hypothetical Reddit user.

-Steve


More information about the Digitalmars-d mailing list