1. wi32lib: RFC for w32string()

Defined in w32utils.e, w32string() is an user defined type which validates
sequence of integers in the 0 to 255 range.

So, for instance, w32string({5,0,255,7}) is 1, but try naming anything this way,
or printing it. Good luck.

This is why I suggest changing its meaning slightly to something probably more
useful:
1/ create a new String_CT w32CType() class, initially identical to Printable_CT.
2/ change w32string() to validate a sequence of characters in the String_CT
class.

This would reject the garbage above, and enable anyone to add accented or double
byte (UTF-16) characters to the range of what w32strung() accepts.

A simpler variant would be to directly tie w32string() to Printable_CT. I don't
know about all uses of this char class by Eu code, so uncoupling the two issues
is 100% safe, at the cost of a new char class.

Any thoughts?

CChris

new topic     » topic index » view message » categorize

2. Re: wi32lib: RFC for w32string()

CChris wrote:
> 
> 
> Defined in w32utils.e, w32string() is an user defined type which validates
> sequence
> of integers in the 0 to 255 range.

<snip>

> Any thoughts?

Yes, w32string is an eu sequence, calling it a string is a misnomer.

Kat

new topic     » goto parent     » topic index » view message » categorize

3. Re: wi32lib: RFC for w32string()

Kat wrote:
> 
> CChris wrote:
> > 
> > 
> > Defined in w32utils.e, w32string() is an user defined type which validates
> > sequence
> > of integers in the 0 to 255 range.
> 
> <snip>
> 
> > Any thoughts?
> 
> Yes, w32string is an eu sequence, calling it a string is a misnomer.
> 
> Kat

I'd only half agree here. It's a plain Eu sequence, representing (usually) a
printable string.

Oh, and after all I didn't coin that name ;)

CChris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu