www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Tidy auto [Was: Re: disable]

reply Jerry Quinn <jlquinn optonline.net> writes:
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;
Jan 18 2010
parent Travis Boucher <boucher.travis gmail.com> writes:
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)
Jan 19 2010