VERSION 2: Re: Proposal: Type inference for variable definition/initialization using the 'auto' keyword.
Joe Darcy
Joe.Darcy at Sun.COM
Tue May 26 15:45:31 PDT 2009
On 05/26/09 03:26 PM, Reinier Zwitserloot wrote:
> replies inline.
>
> --Reinier Zwitserloot
>
>
>
> On May 27, 2009, at 00:10, Tim Lebedkov wrote:
>
>
>> I assume you know about the main disadvantage, but I'll write it one
>> more time:
>> You cannot define a mutable variable using "final".
>>
>
> That's an advantage, actually, because mutating a variable whose type
> is auto inferenced by its first assignment is problematic. e.g:
>
> auto foo = new ArrayList();
> foo = new LinkedList(); //this fails, and that is a clear failure of
> the compiler to Do What I Mean.
>
>
>> I hope we can have a new keyword :-)
>>
>>
>
> We can't. You can ask Joe if you aren't willing to take my word for
> it, but I'll eat my right shoe if a new global keyword (vs. a context
> sensitive one like 'module'), especially something as common as
> 'auto', which I'm sure exists as many a variable name already, is
> deemed acceptable for Project Coin. Seriously. Pigs flying, hell
> freezing over, and other such statements aren't hyperbole here.
>
No new keywords in Project Coin!
-Joe
More information about the coin-dev
mailing list