so me and a cofounder just spent 10 minutes runnin...
# language-proposals
g
so me and a cofounder just spent 10 minutes running down an exception that boils down to a "key not in map exception". One reason is because a junior dev was suppressing the exception, but another reason is because when business rules dictate that a map will contain your key, we simply write
map[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. 3 replies To bring this up again (because its annoyed me again), would the std-lib consider adding an
Copy code
interface Dictionary {

}