Re: String complements

Yes I might have suggested it, but I don't think it works. I can't think of any value that revert("") might produce that will be greater than the value of revert($x) for any non-empty string; other than perhaps some value outside our current value space, like an infinite binary xFFFF.....FF.

Michael Kay

> On 14 Mar 2024, at 10:20, Norm Tovey-Walsh <norm@saxonica.com> wrote:
> 
> Dimitre Novatchev <dnovatchev@gmail.com> writes:
>>   This function can easily handle strings - produce a "string complement" in the value space for a particular collation.
>> 
>>   For a simplified example, revert("abc") would produce "zyx" . This is doable and really valuable.
> 
> In what sense is “zyx” the complement of “abc”? Over what set of codepoints and in what collation?
> 
> I am very skeptical that such a function is well defined across all collations and will always produce a single, correct result in all cases.
> 
> Can you provide a detailed description of how this would work?
> 
>                                        Be seeing you,
>                                          norm
> 
> --
> Norm Tovey-Walsh
> Saxonica

Received on Thursday, 14 March 2024 11:57:11 UTC