Idea: partially pure functions

Robert Fraser fraserofthenight at gmail.com
Wed Apr 30 07:17:53 PDT 2008


Janice Caron wrote:
> 2008/4/30 Bruno Medeiros <brunodomedeiros+spam at com.gmail>:
>>  Example: consider a pure function that takes two strings as arguments,
>> concatenates them, tolower's the first half, and toupper's the second half.
> 
> Not that this in any way changes your argument, but I take it you do
> realise that toupper and tolower cannot be done in place, because the
> UTF-8 sequences representing dchar c might be a different length from
> the UTF-8 sequences representing toupper(c) or tolower(c).
> 
> This is a common misconception popular among people who only use ASCII. :-)

I don't think that was the point of the post... but I never knew that. 
Can you give me an example of a character where the number of bytes in 
that character's representation changes when its case is changed?



More information about the Digitalmars-d mailing list