[swift-evolution] [Draft] Target-specific CChar

William Dillon william at housedillon.com
Thu Mar 3 11:59:48 CST 2016

That’s not a bad idea.  My only concern there is that it’s less obvious where RawByte came from (CChar is pretty self-explanatory).  But I’m far from against it.

> On Mar 3, 2016, at 2:05 AM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>>>>> Could we treat CChar as a "signless" byte type, so that UInt8(cchar) and Int8(cchar) both just reinterpret the bit pattern?
>>>> That is viable, but it opens a whole another can of worms:
>>>> - we need CChar to be a separate type,
>>>> - other unlabelled integer initializers trap when changing the numeric
>>>> value, and this one would be wildly inconsistent.
>>> ... but if we don't provide any arithmetic operations on the CChar
>>> type, and treat it as an opaque byte-sized character type that you can
>>> only convert to UInt8/Int8, it might not be bad!
>> Yeah, it would make sense to me if CChar were opaque and you had to construct an Int8 or UInt8 from it to specify the arithmetic semantics you want.
> I know we're planning to remove `RawByte`, but might it make sense to give it a stay of execution, import `char` as `RawByte`, and add appropriate initializers to convert between it and `Int8`/`UInt8`?
> -- 
> Brent Royal-Gordon
> Architechies
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list