Tidy auto [Was: Re: @disable]

Pelle Månsson pelle.mansson at gmail.com
Sun Jan 17 12:33:23 PST 2010


On 01/17/2010 04:20 PM, bearophile wrote:
> dsimcha:
>> What would this accomplish?  Everyone who's been using D for a while knows that,
>
> It will help people that aren't using D for a lot of time yet, as I have said.
>
>
>> If doing this were more verbose, i.e. if I couldn't just write:
>> immutable y = 2 * x + 1;
>> I might be less inclined to do this.
>
> Is this too much long?
> auto immutable y = 2 * x + 1;
>
> If it's too much long, there are other ways to shorten it (require a syntax change):
> var immutable y = 2 * x + 1;
> Or:
> immutable y := 2 * x + 1;
>
> Bye,
> bearophile

Do you find that the extra : adds a lot of otherwise missing clarity?

I think the way it is now is great. Maybe if the := syntax added 
automatic immutability too, it would be useful.



More information about the Digitalmars-d mailing list