Thomas Nordmeyer
04/29/2020, 6:41 AMvar mapType
get() = map.mapType
set(value) {
map.mapType = value
}
I know we have Delegates but can those be used in a more simple way than my implementation above?Sam Garfinkel
04/29/2020, 6:45 AMsetValue
and getValue
operators for whatever type map
is then you can use var mapType by map
Sam Garfinkel
04/29/2020, 6:47 AMThomas Nordmeyer
04/29/2020, 7:24 AMvar mapType by proxy(map.mapType)
or even
var mapType proxies map.mapType
somehow generic. Quiet common use case when encapsulating 3rd party components.araqnid
04/29/2020, 8:45 AMvar mapType by proxy(map::mapType)
if you’re using it a lot, and then write it up as a suggestion for stdlib