[fpc-devel] strings: a proposeal

Florian Klaempfl florian at freepascal.org
Sun Feb 4 11:58:55 CET 2007


Martin Schreiber schrieb:
> On Sunday 04 February 2007 10.57, Florian Klaempfl wrote:
>> peter green schrieb:
>>> if my understanding is correct this should allow all the widestrings
>>> stuff to be moved to the library and people to implement thier own
>>> string types as required (for example maybe a widestring counterpart
>>> for some system that is similar to com)
>> What's wrong with
>>
>> type
>>    tmywidestring = type array of widechar;
>>
>> ?
> 
> - Null based index.

You can ignore the char 0?

> - mywidestring:= 'abcde'; not possible.

Why not? Overload the := operator?

> - No terminating null character.

This is a matter of implementation, i.e. the helper routines.

> - Lower performance due to nulling memory by setlength.

Overload setlength.

> - No unique check by assigning to character.

True. But maybe we should simply allow to overload [] then.



More information about the fpc-devel mailing list