[bitc-dev] bug in character decode routines

Jonathan S. Shapiro shap at eros-os.org
Thu May 18 23:23:52 EDT 2006


On Thu, 2006-05-18 at 22:11 -0400, Swaroop Sridhar wrote:
> Jonathan S. Shapiro wrote:
> > Do you anticipate any difficulty if we were to switch to using arrays of
> > 4-byte characters instead? I cannot recall whether there may have been a
> > good reason to duplicate these strings at startup time.
> 
> No. But we will also have to set up the length.
> 
> Current bitc_string representation is:
> 
> runtime/bitc/runtime.h:
>    99  typedef struct {
>    100    bitc_word_t length;
>    101    char s[0];                  // unicode UTF-8!
>    102  } bitc_string_t;
> 
> Swaroop.

Right. This is what I thought. Unfortunately there isn't any portable
way to write that initializer. Note also that if we want to support
anything similar to STRING-SET! we are going to have to abandon the UTF8
encoding of strings.

Don't worry about this for now. If we need to deal with it we will deal
with it at a later time. Probably the right thing to do is to simply eat
the extra pointer indirection to the string content bytes, and then we
will be able to initialize them statically.

shap



More information about the bitc-dev mailing list