<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font size="4" face="monospace">Amazingly, yes, value-capable
abstract classes can have fields. We thought for many years this
would never be possible; the Great Initialization Alignment
(eliminating `vnew` and `withfield` in favor of the `new` and
`putfield` approach) made this possible. <br>
<br>
The language imposes no restrictions on the number of fields of
value types. The VM reserves the right to flatten, or not, based
on its whims. One likely whim is that "large" values are usually
not worth flattening. But this is invisible to the user; the
semantics are the same whether or not the object is flattened.<br>
</font><br>
<div class="moz-cite-prefix">On 5/18/2024 1:24 PM, John Bossons
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CACvEv_yCXOUL1wFA3v7uf2N7T84k3=7w+YBaxQaZM_z1RU6kOg@mail.gmail.com">
<div dir="ltr">
<div>Thanks for making this so very clear.</div>
<div><br>
</div>
Two questions/issues:
<div>(1) It would be helpful to include more on the properties
of abstract value classes (AVCs) -- perhaps a labelled
subsection? A specific question not dealt with explicitly in
the current version: Can an AVC have an instance field, now
that a value class utilizes the Flexible Constructor Bodies
JEP? (The alternative is repetition of that field definition
and accessor in every subtype, which is potentially
error-prone). </div>
<div>(2) It would also be helpful to include some commentary on
limitations.</div>
<div>Specifically, although it is clear that the purpose is more
efficiently defined SMALL value objects, (a) How big is
'small'? And (b) will the compiler accept value types of any
size, no matter how deep?</div>
<div><br>
</div>
<div>John</div>
<div>
<div><br>
</div>
<br>
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">Phone: (416) 450-3584 (cell)</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>