infix unicmp

Documentation for infix unicmp assembled from the following types:

language documentation Operators

From Operators

(Operators) infix unicmp

Defined as:

multi sub infix:<unicmp>(Str:D \aStr:D \b --> Order:D)
multi sub infix:<unicmp>(Pair:D \aPair:D \b --> Order:D)
multi sub infix:<coll>(Pair:D \aPair:D \b --> Order:D)

Unlike the cmp operator which sorts according to codepoint, unicmp and coll sort according to how most users would expect, that is, disregarding aspects of the particular character like capitalization.

say 'a' unicmp 'Z'# Less 
say 'a' coll 'Z';   # Less 
say 'a' cmp 'Z';    # More

The main difference between coll and unicmp is that the behavior of the former can be changed by the $*COLLATION dynamic variable.

NOTE: These are not yet implemented in the JVM.