50
51
52
53
54
55
56
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
+
+
+
+
+
+
+
+
+
|
be useful. The two that come to mind are containers -- effectively lists -- and bytearrays.
There's only a single alternative intrep recalled at any time. This is sometimes unwelcome,
and a fair bit of trickery is employed in places to avoid loss of a particularly precious intrep.
Some consideration of a larger number of alternative representations able to co-exist
might be taken. (Pros and cons)
Each object type fully controls the creation, duplication, and release of the internal rep.
However it controls only the creation of the string rep. The overall value system defines
that when it is time to release the string rep, it will be done with <b>ckfree</b>. This
implies that every string rep must be a separately <b>ckalloc</b>'d chunk of memory.
Offering the object type control over the release of string reps would allow for other
possibilities, where a set of values drawn from a small set of static strings might be
done without memory management. Or string reps could be substrings of other
strings kept alive via whatever means is required. This would imply relaxing the
current requirement that objPtr->bytes[objPtr->length] = '\0'
|