D's greatest mistakes

Steven Schveighoffer schveiguy at yahoo.com
Mon Nov 29 13:09:49 PST 2010


On Mon, 29 Nov 2010 16:02:18 -0500, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> Andrei Alexandrescu wrote:
>> Syntax is the main issue in implementing this feature. Due to the  
>> implicit nature of reference semantics for classes, there was no syntax  
>> to distinguish between the head and the tail when qualifying.
>>  FWIW I just thought of this syntax. It might work but it's not  
>> intuitive:
>>  const()C tailConst;
>
> Syntax was not the issue. Back when we tried hard to make this work,  
> there were many syntaxes proposed for it. The issue is the semantic  
> conflation between a reference and what it refers to.

Syntax is the issue.  You can do a tail-const pointer without problems  
because the syntax is intuitive.  It can be done, it just needs syntax to  
do it.  Note that in D, class references are rebindable.  ref references  
are not, we are not talking about ref references, we are talking about  
rebindable references, there is definitely a separation between the  
reference and the data, it's just invisible.

Because we tried hard and failed != it's impossible.

-Steve


More information about the Digitalmars-d mailing list