On Wed, Mar 10, 2010 at 1:28 PM, Sandro Magi <[email protected]> wrote:
> Just use a full word, and the string representation can use a more
> packed form to avoid waste.

This is the position that I think sounds right, but I'm not a Unicode
expert. Let's play with it for a moment.

So you are saying that BitC "char" is 32-bit. That is: a CodePoint.
Assuming this, when we bring in a data structure from C# having a
field of type char, how does that type appear in BitC? As a working
name, let me call it "CodeUnit". Now what relationship, if any, exists
between CodeUnit and BitC char?

> If a full word still cannot encompass the desired set of character, use
> a tagged word representation (like tagged polymorphic representations in
> functional languages), where if the lowest order bit is cleared it's
> unboxed, and if it's set, it's a multiword boxed character.

An important property of the CodeUnit/CodePoint type is that it's a
primitive scalar. Once you need to go to an unboxed representations,
Michal is correct that the right thing to do is use a string.


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to