Issues with constants, and inout (was Real World usage of D, Today)

Sean Kelly sean at f4.ca
Sat Jan 27 09:29:23 PST 2007


Andrei Alexandrescu (See Website For Email) wrote:
> kris wrote:
>>
>> Now we call it:
>>
>> locate ("abc", "ab", 1);
>>
>> Well, the int/uint error goes away (since function matching operates 
>> differently than IFTI matching), but we've now got our old friend back 
>> again -- the constant char[], wchar[], dchar[] mismatch problem.
> 
> I think a sound solution to this should be found. It's kind of hard, 
> because char[] is the worst match but also probably the most used one. 
> The most generous match is dchar[] but wastes much time and space for 
> the minority of cases in which it's useful.

I suppose this is where the difference of opinion comes in, but why do 
you think char[] is the worst match?  From what I understand, UTF-8 
seems preferable to UTF-16 in most cases.  The algorithm for dealing 
with such strings must be essentially the same in both cases, and UTF-8 
tends to be more compact on average.


Sean



More information about the Digitalmars-d mailing list