Another more OO approach would be to make the obje...
# random
c
Another more OO approach would be to make the objects you pass conform to some
interface IHasName { val name: String}
but it’s heavier and it might not be an option (if one of these objects has a type coming from a library, you can’t make it conform to
IHasName
, hence the functional approach)