PROPOSAL: Enhanced for each loop iteration control

Joseph D. Darcy Joe.Darcy at Sun.COM
Sat May 16 18:53:37 PDT 2009

PS A join facility for string is being tracked with Sun bug 5015163 
"(str) String merge/join that is the inverse of String.split()."

To me this sounds like a fine bug to be fixed in JDK 7:


Joseph D. Darcy wrote:
> Reinier Zwitserloot wrote:
>> If the proposal was just about making the iterator available, I'd 
>> agree with you, but the proposal adds methods like .first(), which 
>> are /very/ useful indeed. It's right up there with ARM, and easily 
>> beats string switching, in how applicable that would be.
> A library to implement the utility wrapper around an Iterator could be 
> added without the language change.
>> Adding a .join() method to String or List (depending on taste) would 
>> solve over half of the use-cases for the extended forloop, though.
> Adding one method to string is preferable to a language change!
> -Joe

More information about the coin-dev mailing list