An example of substituability test that is recursive

John Rose john.r.rose at
Thu Jan 31 18:03:13 UTC 2019

On Jan 31, 2019, at 3:19 AM, Remi Forax <forax at> wrote:
> here is an example that recurse to its death with the current prototype

Fun fact:  Change the Link to a Tree and you go from
linear to exponential in the depth.  *Just* a fun fact;
it doesn't change Remi's point, which is that we can
construct value object instances that have large

(Definition of the day:  The "interior" of a value
object instance is the set of variables that determine
its substitutability equality and substitutability hash.)

To me this takes on a different shade of urgency
when I think about turning arrays into values.
Suppose we had Arrays.valueCopyOf to take an
immutable value-typed snapshot of an array.
Very useful!  (Sort of like frozen arrays.)  You
can make a size 1_000 value-array very quickly
and easily, and its interior would be as large
as Remi's laboriously constructed list.

More information about the valhalla-spec-observers mailing list