January 18, 2010 Re: Tidy auto [Was: Re: @disable] | ||||
|---|---|---|---|---|
| ||||
bearophile Wrote:
> myself). If this is true then a syntax like:
> auto immutable x = y * 2;
>
> can be seen as too much long and boring to write all the time, so the "immutable" keyword may need to be changed again :-) For example into "val" (also as "retard" has said), so it becomes shorter (here "auto" is present if and only if the programmer wants type inference, as I have written in other posts, to clean up its semantics):
> auto val x = y * 2;
How about "fixed"? It's a little longer than val, but still carries "set in stone" semantics.
auto fixed x = y * 2;
| ||||
January 19, 2010 Re: Tidy auto [Was: Re: @disable] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jerry Quinn | Jerry Quinn wrote:
> bearophile Wrote:
>
>> myself). If this is true then a syntax like:
>> auto immutable x = y * 2;
>>
>> can be seen as too much long and boring to write all the time, so the "immutable" keyword may need to be changed again :-) For example into "val" (also as "retard" has said), so it becomes shorter (here "auto" is present if and only if the programmer wants type inference, as I have written in other posts, to clean up its semantics):
>> auto val x = y * 2;
>
> How about "fixed"? It's a little longer than val, but still carries "set in stone" semantics.
>
> auto fixed x = y * 2;
>
It'd be nice to not introduce 'fixed' unless it referred to fixed point math. (not using it at all leaves the openings for vendor extensions targeting embedded platforms)
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply