"<Type> is not mutable" when using ref return type

Muffin mydog at muffin.com
Thu May 19 11:53:30 PDT 2011


On 19/05/11 1:25 PM, %u wrote:
> Hi!
>
> Is this a bug, or is it intentional that this fails? I can't come up
> with any case where it would cause a problem, but the compiler doesn't
> like the fact that there's a const in the structure:
>
>      struct Temp { const int a; int b; }
>
>      auto ref foo(Temp* t) { return *t; } //Error

Just about all D type modifier keywords like const, shared, immutable 
and friends are completely broken semantically (i.e. TFBR**) and so 
there is very little hope that there will ever be a fix for these type 
system issue problems.

(** TFBR Totally fucked beyond repair)

Muffin's tip on the programming languages stocks (aka the PLS-2011 
index) is to stay with your current investment in D2 for as long as the 
proprietary digitalmars implementation serves your purpose and to short 
sell otherwise.  This is code for saying that the open source world is 
unlikely to ever provide any alternative to the currently available 
bug-ridden proprietary implementation of D2 which is itself, as a 
language specification, is riddled with bugs.

Unfortunately there is no options market on D stock so that those of you 
that might be thinking of doing a PUT or CALL on D will be as bitterly 
disappointed as others that have tried to measure temperature in a vaccuum.

xxx


More information about the Digitalmars-d mailing list