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

Tim Lebedkov tim.lebedkov at googlemail.com
Mon May 25 13:31:16 PDT 2009


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.
>



More information about the coin-dev mailing list