Wouldn't this be nice?

Joshua Bloch jjb at google.com
Wed Nov 11 10:14:51 PST 2009


Eammon,

That's a great idea!  In fact, it's a compelling reason to support the
feature.

           Josh

On Wed, Nov 11, 2009 at 10:05 AM, Eamonn McManus <Eamonn.McManus at sun.com>wrote:

>   What I'm really sorry that I didn't put into the original statement is:
>
>   for (char c : myString)
>
> which would also work on other CharSequences. Oh well, maybe someday
>
>  That would certainly be awfully nice, especially if it also worked for
> code points in general, as in
>
>     for (int c : myString)
>
> Getting the right behaviour using the codePointCount and codePointAt and
> charCount methods of Character is really tedious, but necessary if you want
> your code to be fully international. There are ways to abstract it away a
> bit in the current language, but they're kind of clunky.
>
> Éamonn
>
> Joshua Bloch wrote:
>
> Paulo,
>
> I have a hard time intuiting the semantics by just looking a the statement.
>  What I'm really sorry that I didn't put into the original statement is:
>
>   for (char c : myString)
>
> which would also work on other CharSequences. Oh well, maybe someday.
>
>        Josh
>
> On Wed, Nov 11, 2009 at 8:38 AM, Paulo Levi <i30817 at gmail.com> <i30817 at gmail.com> wrote:
>
>
>
>  Probably you figured out i wanted:
> for(int i : infos.length - 1)
>
> sigh.
>
>
>
>
>



More information about the coin-dev mailing list