Nir07/08/2019, 3:12 PM
and companion objects, philosophically
and it's an ordinary, well behaved class, you can then have a global of type
(never mind details of safe initialization at the moment)
object globalLogger (..) : Logger
runjorel07/08/2019, 3:19 PM
Nir07/08/2019, 3:21 PM
just to have functions that are not associated with a specific object
streetsofboston07/08/2019, 3:33 PM
like (companion) objects and functions are not only useful for maintaining a global state. They can also be used for name-spacing/scoping of functionality.
Nir07/08/2019, 3:36 PM
karelpeeters07/08/2019, 5:06 PM
Wilhelm Fitzpatrick07/08/2019, 5:14 PM
karelpeeters07/08/2019, 5:15 PM
Nir07/08/2019, 5:33 PM
and companions are basically singleton enabling devices, I can't really imagine using them for anything that doesn't require a singleton.
itself extremely minimal.