Hi there. When using a mutable map, why can't I do...
# stdlib
h
Hi there. When using a mutable map, why can't I do
map.getOrDefault(key){ ... build default value lazily here .. }
similar to how the message is evaluated in
require
?
s
I think you want
getOrPut()
or
getOrElse()
depending on the specific semantics you’re looking for
🙂 1
👍 2
👆🏼 1
h
Indeed that is exactly what I want to do. Thank your for your kind help
👍 1