I've used these kinds of operations in C# for a long time, and they're certainly useful. C# benefits from using Scala's compact syntax (not to mention real closures), but I think even in the more verbose Java syntax your proposals could make a programmer's intentions clearer than the traditional loop style. I've been porting some C# code to Pivot recently and wished I had a few of those mapping methods available to me. So I say go for it.
--Bill p.s. I really wish the Pivot List implemented a few more of the operations that java.util.List implements. You note *addAll*, which is often useful; even more so I'd like *contains*, which I use often enough that I wrote my own static utility method for it. On Thu, Sep 8, 2011 at 4:21 PM, Sandro Martini <[email protected]>wrote: > Hi all, > > I'd like to ask to you a crazy idea I had in last weeks ... you > remember the question of last week on add some methods to Pivot > collections ? > It's here: > http://apache-pivot-developers.417237.n3.nabble.com/No-quot-addAll-quot-method-on-ArrayList-td3281354.html > > After thinking on it, and trying to expand the idea (and you know that > I'm a great fan of Scala) ... so what do you think (for the 2.1 > release) to add some methods to pivot collections to be able to pass a > Function (a Pivot new class to map simple functions, all for Java ... > and the name is only a proposal) and have the collection to apply it > over all their elements ? > Do you think could be interesting/useful, at least for what it's your > experience on Pivot ? > ... > >
