jw
03/10/2016, 8:23 PMMap<K, List<V>>
instances by appending listscedric
03/10/2016, 8:25 PMorangy
map.update { k,v -> v }
function. Thinking out loud as well.orangy
map1.update { k,v -> v + map2[k] ?: emptyList() }
or somethingjw
03/12/2016, 8:20 PMjw
03/12/2016, 8:20 PMkirillrakhman
03/16/2016, 9:37 AMIterable.map
is eager and for lazy map
we have sequences but what if I truly need a transformed view of a list with random access? Guava's Lists.transform
does just that but I'm trying to get rid of Guava.orangy
List
implementation.orangy
kirillrakhman
03/16/2016, 9:56 AMorangy
orangy
filter
or other operators with unknown size/index of a resulting collectionkirillrakhman
03/16/2016, 9:58 AMorangy
orangy
kirillrakhman
03/16/2016, 10:02 AMkirillrakhman
03/16/2016, 10:02 AMorangy
AbstractList
and implement delegation with mapping? Shouldn’t be a lot of effort.kirillrakhman
03/16/2016, 10:06 AMkirillrakhman
03/16/2016, 10:08 AMAbstractList
throwing exceptions on all mutating operationskirillrakhman
03/16/2016, 10:09 AMList
never was intended to be mutable by defaultnatpryce
03/16/2016, 11:26 AMmikehearn
03/16/2016, 12:16 PMfellshard
03/18/2016, 3:08 AMcedric
03/18/2016, 4:04 AMfellshard
03/18/2016, 4:34 AMList
interface of Java's collections. How simple is it to create your own implementation? What kind of constraints are placed on the general concept of a list that are unnecessary at that level of detail? As an SDK construct, one would expect small, composable interfaces to enable usage of parts of functionality in different contexts, but the SDK encourages depending on vast swathes of functionality simultaneously with its bloated implementations.
To be fair, I have a hard time gauging what exactly causes that inflexibility. Could be an overreliance on inheritance over composition, but I'm not sure. It's easily seen in the collections, as others have noted. Just take the SOLID principles, start wading through the SDK, and marvel at how incoherent the structure can be.
Standard does not mean good. It means just that - standard, the foundation that everyone shares. Much like Java itself, it's used because everyone uses it, not because it is of high quality.fellshard
03/18/2016, 4:35 AMcedric
03/18/2016, 5:18 AMCanBuildFrom
and all?fellshard
03/18/2016, 5:18 AMfellshard
03/18/2016, 5:21 AM