groostav
06/26/2017, 5:48 PMmap[key]!!
. I suppose this is our mistake and we should instead write map[key] ?: keyNotFound(map, key)
but that's clunkey. Could write an extension function but that means we loose the slick square-brackets syntax, and its though to make idioms without them being part of the standard-lib.ilya.gorbunov
06/26/2017, 6:22 PMMap.getValue(key)
is a part of stdlibgroostav
06/26/2017, 8:37 PMmap[key]
to map.getValue(key)
groostav
07/14/2017, 1:06 AM/** doc that says its not like javas dictionary but C#s dicitonary*/
interface Dictionary<K, V> {
operator fun get(key: Key): V //nonnullable V
//...
}
fun <K, V> Map<K, V>.asDictionary() = doFacading()
?poohbar
07/14/2017, 4:03 PMgroostav
07/14/2017, 4:49 PMDictionary
and a method asDictionary()
to give you back something that works with nonnull return valuesilya.gorbunov
07/14/2017, 4:52 PM