arrays

Henry Cejtin henry@sourcelight.com
Thu, 4 Jan 2001 01:35:52 -0600


re the array flattening transformation, I assume that nothing can currently
be done in the case that the array elements are values of some datatype which
has actual unions with 2 or more cases being `large'.
I.e., consider
	datatype t = A of int
		   | B of real
Note that space-wise, the optimal storage is 9 bytes per element (one byte
tag, with 4 bytes of junk if the tag is A).  If you have to go indirect for
the value being carried, then it costs a lot (although if there is a lot of
sharing of reals it could save some space).
Any way, the point is that I don't think that there is a way to express this
chunk of memory large enough to hold the largest case with a tag that tells you
which it is.