Latest const expansion
Yigal Chripun
yigal100 at gmail.com
Tue Sep 11 11:24:26 PDT 2007
Janice Caron wrote:
> On 9/11/07, Yigal Chripun <yigal100 at gmail.com> wrote:
>> my proposal is to simply use the terms tail/head, so the syntax will be
>> [head|tail] const (T) | const T
>>
>> for example:
>> head const (C) c; // c is const but c.x isn't
>> tail const (C) c; // c is mutable but c.x is const
>> const (C) c; // as before, both c and c.x are const
>> head const C c; // Error
>> tail const C c; // Error
>
> head and tail are good variable names, so I'd rather they didn't
> become reserved words.
>
> But I've no problem with headconst and tailconst.
>
> Only ... would that mean we'd then also have to have a tailtailconst?
agreed, no need to make tail/head reserved words.
i thought 1 level of "tailness" is enough to cover 99% of cases...
can you give a use case for "tailtailconst" that can't be resolved with
a combination of the const parens and tailconst?
More information about the Digitalmars-d
mailing list