dimsuz
01/14/2017, 11:38 PMbind
?voddan
01/19/2017, 3:06 PMPlease, consider them naming top-level functions simply min/max like in all(?) other languages and in mathematics.https://youtrack.jetbrains.com/issue/KT-7417#comment=27-1721394
ilya.gorbunov
01/19/2017, 3:11 PMvoddan
01/19/2017, 3:11 PMvoddan
01/19/2017, 3:12 PMilya.gorbunov
01/19/2017, 3:13 PMilya.gorbunov
01/19/2017, 3:14 PMDid we have a KEEP for this?No, but you can comment in that issue
fellshard
01/19/2017, 3:15 PMminOf
and maxOf
make me think they take multiple. /shrugfellshard
01/19/2017, 3:15 PMnimtiazm
01/19/2017, 5:13 PMnimtiazm
01/19/2017, 5:14 PMnimtiazm
01/19/2017, 6:13 PMh0tk3y
01/20/2017, 1:22 PM.getValue(key)
having the same name as the delegate operator concerns me a bit, especially given that the delegate is implemented in stdlib, so that the two functions are shown together in IDE completion. Do you think it might be a source of confusion? For me, it was when I first tried to use it.ilya.gorbunov
01/20/2017, 1:28 PMgetValue
name. If it would be a source of confusion, we could tune the completion somehow.Chris Miller
01/20/2017, 4:57 PMilya.gorbunov
01/20/2017, 5:03 PMilya.gorbunov
01/20/2017, 5:05 PMrobin
01/20/2017, 7:45 PMmonth
property, which the list is already sorted by. I want a new version of that list where there is an additional element between every two neighbouring items that have different month
properties. Can this be accomplished in an easy, functional way with the stdlib functions or do I have to manually iterate through the list?voddan
01/20/2017, 7:58 PMh0tk3y
01/20/2017, 7:59 PMMap.getOrDefault(K): V
. Though this naming correlates with Map.getOrDefault(K, V): V
, the latter has much closer semantics to the subject (and this correlation might even hint that the default value should be provided from somewhere else). Otherwise, an option I like even more is to expose the internal function getOrImplicitDefault
or to choose its naming.h0tk3y
01/20/2017, 8:00 PMgetValue(key)
is that the name itself says nothing about the implicit default being used. That is, nothing in it hints that it might return a value that a simple get
would not.h0tk3y
01/20/2017, 8:03 PMMap.getOrDefault(K): V
, because of the Map.getOrDefault(K, V): V
not using the implicit default.ilya.gorbunov
01/20/2017, 8:04 PMilya.gorbunov
01/20/2017, 8:06 PMtoMutableList
, binarySearch
and then just insert it with add(index, element)
ilya.gorbunov
01/20/2017, 8:08 PMmonth
robin
01/20/2017, 8:11 PMmg6maciej
01/20/2017, 8:11 PMrobin
01/20/2017, 8:12 PMmg6maciej
01/20/2017, 8:18 PMrobin
01/20/2017, 8:18 PM