[M3devel] Do we really want to truncate wide chars?

Rodney M. Bates rodney_bates at lcwb.coop
Fri May 24 20:00:19 CEST 2013


Actually, it's hard for me to imagine what would not be broken if we leave
it as is, and it happens.  Can lopping off high bits off of a character code
be a meaningful mapping?

The only thing I can think of is if somebody used the Text mechanism as
a handy way to manipulate strings of integers of some kind that represented
something other than characters.  Even then, it seems a stretch that
truncation could accomplish anything wanted.

On 05/23/2013 07:30 PM, Antony Hosking wrote:
> I’ve not given much thought to it.  What might break?
>
> On May 24, 2013, at 10:10 AM, "Rodney M. Bates" <rodney_bates at lcwb.coop> wrote:
>
>> Right now, the implementations of Text.GetChar and Text.SetChars that we got with
>> cm3, silently truncate any of the requested characters whose value won't fit in
>> the range of CHAR.  Do we really want this behavior?  Is there any existing code
>> that depends on it?  I can't imagine a case where client code would want this.
>>
>> I propose we change it to either give a checked runtime error or raise an
>> explicitly declared exception, if the value won't fit in a CHAR.
>>
>> Any thoughts?
>>
>>
>
>




More information about the M3devel mailing list