<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<br>
<blockquote type="cite" cite="mid:CAJq4Gi4UJBKYR1nuBTCfAH__2K6XubTu+_Knz0QpSZpKadkHyA@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div> <br>
The approach of companion objects rather than static
members provides a useful nudge to thinking of the static
parts of a class as being a single, independent entity.<br>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>Independent entity, yes. Single, maybe. </div>
</div>
</div>
</blockquote>
<br>
Right. The companion mechanism in Kotlin pushes pretty hard at
"single"; the companion mechanism in Scala is somewhere in the
middle, where it use a magic name association between a class called
X and an object called X, but you can also have objects whose name
is separate from any class and it can stand as an independent
sub-part. If we went down this road, we would probably go even
farther, where the analogue of `object` would be more like a
general-purpose singleton class which you could freely mix and match
with. It's not all that different from using IODH today from an
expressiveness perspective, but (like with enums) it moves instance
management from the user's side of the ledger to the language's
side. Let's say that this is a possibility we could explore if we
suspected there were a bigger potential payoff. <br>
</body>
</html>