<div dir="ltr"><div dir="ltr">Am Mo., 18. Juli 2022 um 03:39 Uhr schrieb Chris Muller <<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>>:<br></div><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 dir="ltr"><div dir="ltr"><div><b>Text</b> is unique in the image from the aspect of it being the only class that is simultaneously a <i>byte</i> <u>and</u> <i>pointer</i> object.  Thanks to the magic of TextAnchor's, any character of a Text is allowed to be a pointer object.  It's implemented by (Character value: 1) being yet another special substitution performed dynamically during layout. </div></div></div></blockquote><div><br></div><div>As I mentioned in my previous email, if the String methods were simply pulled up, some of them would turn Texts to Strings in their answers. In this case, the `Character startOfHeader` would remain in the string, but the TextAnchor would, of course, be lost, and the attached object along with it.</div><div><br></div><div>Either some selectors would be known to discard Text features, or Text would have to refine them to preserve these features, or these methods would need to be refactored to a more general (maybe less efficient?) implementation that allows Text to preserve its features. In some cases this could be as simple as using self class streamContents: instead of String streamContents:, but it will certainly be more complicated in other cases. So before drawing any conclusions, we need more thorough analysis of the offending methods.</div><div><br></div><div>Some methods should probably simply not be pulled up. For example, I do not see the usefulness of computing a CRC on a Text (ignoring its attributes), converting one to a VM file path, or decoding a URL from one. But I suppose one could also ask: why not if you can theoretically do these things with sequences of characters...</div><div><br class="gmail-Apple-interchange-newline">PS. CompiledMethods are also a combination of bytes and pointers, and in their case, even the VM treats them as such. Text on the other hand is not strictly speaking a byte object, since the bytes or (words in WideString) are in its string object. 🤓 But I got your point that Text embodies both characters and other objects and may therefore have different requirements.<br></div><div><br></div></div></div>