VERSION 2: Re: Proposal: Type inference for variable definition/initialization using the 'auto' keyword.

Howard Lovatt howard.lovatt at iee.org
Mon May 25 15:48:52 PDT 2009


The suggestion of making auto optional seems like a good idea to me as
it has a lot of use cases.

 -- Howard.

2009/5/26 Tim Lebedkov <tim.lebedkov at googlemail.com>:
> Hello Howard,
> (Jeremy - FYI)
>
> I have thought about it also. It would be useful to make "auto" optional.
> It was just not in the original proposal. And it would help (I'm not
> quite sure whether it is enough) with the "final" proposal from Jeremy
> Manson
> http://mail.openjdk.java.net/pipermail/coin-dev/2009-February/000009.html.
>
> Making "auto" optional would also allow code like
>
> static a = "clouds";
>
> or
>
> private b = 44;
>
> I'm not quite sure yet whether I can change my proposal and about the
> implications and acceptance (and possible danger to the whole
> proposal) of this change.
>
> Regards
> --Tim
>
>
> On Mon, May 25, 2009 at 1:00 AM, Howard Lovatt <howard.lovatt at iee.org> wrote:
>> The example:
>>
>> final auto list = new ArrayList<String>();
>>
>> seems strange, why not:
>>
>> final list = new ArrayList<String>();
>>
>> After all you are trying to reduce verbosity and making final
>> declarations the same length as variable ones will encourage people to
>> use final more, which is a good thing. The use of just final has been
>> proposed by many people for Java already, it won't break code.  Also
>> this final only construct is consistent with other languages e.g.
>> Scala, JavaFX, etc. that use def and var (final and auto
>> respectively).
>>
>>  -- Howard.
>>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>



-- 
  -- Howard.



More information about the coin-dev mailing list