txt: ## operators.md
  ## Chunk 3 of 6
  aku
  multi infix:<->($a, $b --> Numeric:D)
  ```
  
  Subtraction operator: Coerces both arguments to [`Numeric`](/type/Numeric) and subtracts the second from the first. From version 6.d it works also on [`Duration`](/type/Duration), [`DateTime`](/type/DateTime) and [`Real`](/type/Real) types.
  
  ## [infix `+|`](#Operators "go to top of document")[§](#infix_+| "direct link")
  
  ```raku
  multi infix:<+|>($a, $b --> Int:D)
  ```
  
  Integer bitwise OR operator: Coerces both arguments to [`Int`](/type/Int) and does a bitwise *OR* (inclusive OR) operation.
  
  ## [infix `+^`](#Operators "go to top of document")[§](#infix_+^ "direct link")
  
  ```raku
  multi infix:<+^>($a, $b --> Int:D)
  ```
  
  Integer bitwise XOR operator: Coerces both arguments to [`Int`](/type/Int) and does a bitwise *XOR* (exclusive OR) operation.
  
  ```raku
  say (0b00001101 +^ 0b00001001).base(2); # OUTPUT: «100␤»
  
  ```
  
  ## [infix `~|`](#Operators "go to top of document")[§](#infix_~| "direct link")
  
  Coerces each argument to a non-variable-encoding string buffer type (e.g. `buf8`, `buf16`, `buf32`) and then performs a numeric bitwise OR on corresponding integers of the two buffers, padding the shorter buffer with zeroes.
  
  ## [infix `~^`](#Operators "go to top of document")[§](#infix_~^ "direct link")
  
  Coerces each argument to a non-variable-encoding string buffer type (e.g. `buf8`, `buf16`, `buf32`) and then performs a numeric bitwise XOR on corresponding integers of the two buffers, padding the shorter buffer with zeroes.
  
  ## [infix `?^`](#Operators "go to top of document")[§](#infix_?^ "direct link")
  
  ```raku
  multi infix:<?^>(Mu $x = Bool::False)
  multi infix:<?^>(Mu \a, Mu \b)
  ```
  
  Boolean logical XOR operator. Coerces the argument(s) to [`Bool`](/type/Bool) and performs logical XOR on it(them): it will return True if and only if just one of the argument is True. On a single argument it behaves as identity, returning the coerced value.
  
  ## [infix `?|`](#Operators "go to top of document")[§](#infix_?| "direct link")
  
  ```raku
  multi infix:<?|>(Mu $x = Bool::False)
  multi infix:<?|>(Mu \a, Mu \b)
  ```
  
  Boolean logical OR operator. Coerces the argument(s) to [`Bool`](/type/Bool) and performs logical OR (inclusive OR) on it(them): it will return True if at least one of the argument is True. On a single argument it behaves as identity, returning the coerced value.
  
  # [Replication precedence](#Operators "go to top of document")[§](#Replication_precedence "direct link")
  
  ## [infix `x`](#Operators "go to top of document")[§](#infix_x "direct link")
  
  ```raku
  sub infix:<x>($a, $b --> Str:D)
  ```
  
  String repetition operator.
  
  Repeats the string `$a` `$b` times, if necessary coercing `$a` to [`Str`](/type/Str) and `$b` to [`Int`](/type/Int). Returns an empty string if `$b <= 0`. An exception `X::Numeric::CannotConvert` will be thrown if `$b` is `-Inf` or `NaN`.
  
  ```raku
  say 'ab' x 3;           # OUTPUT: «ababab␤»
  say 42 x 3;             # OUTPUT: «424242␤»
  
  my $a = 'a'.IO;
  my $b = 3.5;
  say $a x $b;            # OUTPUT: «aaa␤»
  ```
  
  ## [infix `xx`](#Operators "go to top of document")[§](#infix_xx "direct link")
  
  ```raku
  multi infix:<xx>()
  multi infix:<xx>(Mu \x)
  multi infix:<xx>(&x, Num:D() $n)
  multi infix:<xx>(&x, Whatever)
  multi infix:<xx>(&x, Bool:D $b)
  multi infix:<xx>(&x, Int:D $n)
  multi infix:<xx>(Mu \x, Num:D() $n)
  multi infix:<xx>(Mu \x, Whatever)
  multi infix:<xx>(Mu \x, Bool:D $b)
  multi infix:<xx>(Mu \x, Int:D $n)
  ```
  
  List repetition operator
  
  In general, it returns a Sequence of `$a` repeated and evaluated `$b` times (`$b` is coerced to [`Int`](/type/Int)). If `$b <= 0`, the empty list is returned. It will return an error with no operand, and return the operand itself with a single operand. An exception [`X::Numeric::CannotConvert`](/type/X/Numeric/CannotConvert) will be thrown if `$b` is `-Inf` or `NaN`.
  
  The left-hand side is evaluated for each repetition, so
  
  ```raku
  say [1, 2] xx 5;
  # OUTPUT: «([1 2] [1 2] [1 2] [1 2] [1 2])␤»
  ```
  
  returns five distinct arrays (but with the same content each time), and
  
  ```raku
  rand xx 3
  ```
  
  returns three pseudo random numbers that are determined independently.
  
  The right-hand side can be `*`, in which case a lazy, infinite list is returned. If it's a [`Bool`](/type/Bool), a [`Seq`](/type/Seq) with a single element is returned if it's `True`.
  
  # [Concatenation](#Operators "go to top of document")[§](#Concatenation "direct link")
  
  Same as the rest of the infix operators, these can be combined with metaoperators such as [assignment](#Assignment_operators), for instance.
  
  ## [infix `~`](#Operators "go to top of document")[§](#infix_~ "direct link")
  
  ```raku
  multi infix:<~>(Any,   Any)
  multi infix:<~>(Str:D, Str:D)
  multi infix:<~>(Buf:D, Buf:D)
  multi infix:<~>(Blob:D $a, Blob:D $b)
  multi infix:<~>(Junction:D \a, Junction:D \b)
  ```
  
  This is the string concatenation operator, which coerces both arguments to [`Str`](/type/Str) and concatenates them. If both arguments are [`Buf`](/type/Buf), a combined buffer is returned.
  
  ```raku
  say 'ab' ~ 'c';     # OUTPUT: «abc␤»
  my $bob = Blob.new([1,2,3]);
  my $bao = Blob.new([3,4,5]);
  say $bao ~ $bob;     # OUTPUT: «Blob:0x<03 04 05 01 02 03>␤»
  
  ```
  
  The arity-1 version of this operator will be called when the hyper version of the operator is used on an array or list with a single element, or simply an element
  
  ```raku
  say [~] Blob.new([3,4,5]);     # OUTPUT: «Blob:0x<03 04 05>␤»
  say [~] 1|2;                   # OUTPUT: «any(1, 2)␤»
  
  ```
  
  ## [infix `o`, infix `∘`](#Operators "go to top of document")[§](#infix_o,_infix_∘ "direct link")
  
  ```raku
  multi infix:<o>()
  multi infix:<o>(&f)
  multi infix:<o>(&f, &g --> Block:D)
  ```
  
  The function composition operator `infix:<∘>` or `infix:<o>` combines two functions, so that the left function is called with the return value of the right function. If the [`.count`](/routine/count) of the left function is greater than 1, the return value of the right function will be [slipped](/type/Slip) into the left function.
  
  Both `.count` and `.arity` of the right-hand side will be maintained, as well as the `.of` of the left hand side.
  
  ```raku
  sub f($p){ say 'f'; $p / 2 }
  sub g($p){ say 'g'; $p * 2 }
  
  my &composed = &f ∘ &g;
  say composed 2; # OUTPUT: «g␤f␤2␤»
  # equivalent to:
  say 2.&g.&f;
  # or to:
  say f g 2;
  say &composed.arity; #  OUTPUT: «1␤»
  say &composed.count; #  OUTPUT: «1␤»
  say &composed.of;    #  OUTPUT: «(Mu)␤»
  
  ```
  
  ```raku
  sub f($a, $b, $c) { [~] $c, $b, $a }
  sub g($str){ $str.comb }
  my &composed = &f ∘ &g;
  say composed 'abc'; # OUTPUT: «cba␤»
  # equivalent to:
  say f |g 'abc';
  
  ```
  
  The single-arg candidate returns the given argument as is. The zero-arg candidate returns an identity routine that simply returns its argument.
  
  ```raku
  my &composed = [∘] &uc;
  say composed 'foo'; # OUTPUT: «FOO␤»
  
  my &composed = [∘];
  say composed 'foo'; # OUTPUT: «foo␤»
  ```
  
  # [Junctive AND (all) precedence](#Operators "go to top of document")[§](#Junctive_AND_(all)_precedence "direct link")
  
  ## [infix `&`](#Operators "go to top of document")[§](#infix_& "direct link")
  
  ```raku
  multi infix:<&>($a, $b --> Junction:D) is assoc<list>
  ```
  
  All junction operator.
  
  Creates an *all* [`Junction`](/type/Junction) from its arguments. See [`Junction`](/type/Junction) for more details.
  
  ## [infix `(&)`, infix `∩`](#Operators "go to top of document")[§](#infix_(&),_infix_∩ "direct link")
  
  ```raku
  multi infix:<(&)>(**@p)
  ```
  
  Intersection operator.
  
  '&' as in left hand side arguments 'and' right hand side arguments. Returns the **intersection** of all of its arguments. This creates a new [`Set`](/type/Set) that contains only the elements common to all of the arguments if none of the arguments are a [`Bag`](/type/Bag), [`BagHash`](/type/BagHash), [`Mix`](/type/Mix) or [`MixHash`](/type/MixHash).
  
  ```raku
  say <a b c> (&) <b c d>; # OUTPUT: «Set(b c)␤»
  say <a b c d> ∩ <b c d e> ∩ <c d e f>; # OUTPUT: «Set(c d)␤»
  
  ```
  
  If any of the arguments are [`Baggy`](/type/Baggy) or [`Mixy`](/type/Mixy), the result is a new [`Bag`](/type/Bag) (or [`Mix`](/type/Mix)) containing the common elements, each weighted by the largest *common* weight (which is the minimum of the weights of that element over all arguments).
  
  ```raku
  say <a a b c a> (&) bag(<a a b c c>); # OUTPUT: «Bag(a(2) b c)␤»
  
  ```
  
  ## [infix `(.)`, infix `⊍`](#Operators "go to top of document")[§](#infix_(.),_infix_⊍ "direct link")
  
  ```raku
  multi infix:<(.)>(**@p)
  ```
  
  Baggy multiplication operator.
  
  Returns the Baggy **multiplication** of its arguments, i.e., a [`Bag`](/type/Bag) that contains each element of the arguments with the weights of the element across the arguments multiplied together to get the new weight. Returns a [`Mix`](/type/Mix) if any of the arguments is a [`Mixy`](/type/Mixy).
  
  ```raku
  say <a b c> (.) <a b c d>; # OUTPUT: «Bag(a b c)␤»
                             # Since 1 * 0 == 0, in the case of 'd'
  say <a a b c a d> ⊍ bag(<a a b c c>); # OUTPUT: «Bag(a(6) b c(2))␤»
  
  ```
  
  # [Junctive OR (any) precedence](#Operators "go to top of document")[§](#Junctive_OR_(any)_precedence "direct link")
  
  ## [infix `|`](#Operators "go to top of document")[§](#infix_| "direct link")
  
  ```raku
  multi infix:<|>($a, $b --> Junction:D) is assoc<list>
  ```
  
  Creates an *any* [`Junction`](/type/Junction) from its arguments.
  
  ```raku
  my $three-letters = /<[a b c]>/ | /<[i j k]>/ | /<[x y z]>/;
  say $three-letters.raku; # OUTPUT: «any(/<[a b c]>/, /<[i j k]>/, /<[x y z]>/)␤»
  say 'b' ~~ $three-letters; # OUTPUT: «True␤»
  ```
  
  This first creates an `any` [`Junction`](/type/Junction) of three regular expressions (every one of them matching any of 3 letters), and then uses smartmatching to check whether the letter `b` matches any of them, resulting in a positive match. See also [`Junction`](/type/Junction) for more details.
  
  ## [infix `(|)`, infix `∪`](#Operators "go to top of document")[§](#infix_(|),_infix_∪ "direct link")
  
  ```raku
  multi infix:<(|)>(**@p)
  ```
  
  Union operator.
  
  '|' as in left hand side arguments 'or' right hand side arguments.
  
  Returns the **union** of all of its arguments. This creates a new [`Set`](/type/Set) that contains all the elements its arguments contain if none of the arguments are a [`Bag`](/type/Bag), [`BagHash`](/type/BagHash), [`Mix`](/type/Mix) or [`MixHash`](/type/MixHash).
  
  ```raku
  say <a b d> ∪ bag(<a a b c>); # OUTPUT: «Bag(a(2) b c d)␤»
  
  ```
  
  If any of the arguments are [`Baggy`](/type/Baggy) or [`Mixy`](/type/Mixy), the result is a new [`Bag`](/type/Bag) (or [`Mix`](/type/Mix)) containing all the elements, each weighted by the *highest* weight that appeared for that element.
  
  ```raku
  say <a b d> ∪ bag(<a a b c>); # OUTPUT: «Bag(a(2) b c d)␤»
  
  ```
  
  ## [infix `(+)`, infix `⊎`](#Operators "go to top of document")[§](#infix_(+),_infix_⊎ "direct link")
  
  ```raku
  multi infix:<(+)>(**@p)
  ```
  
  Baggy addition operator.
  
  Returns the Baggy **addition** of its arguments. This creates a new [`Bag`](/type/Bag) from each element of the arguments with the weights of the element added together to get the new weight, if none of the arguments are a [`Mix`](/type/Mix) or [`MixHash`](/type/MixHash).
  
  ```raku
  say <a a b c a d> (+) <a a b c c>; # OUTPUT: «Bag(a(5) b(2) c(3) d)␤»
  
  ```
  
  If any of the arguments is a [`Mixy`](/type/Mixy), the result is a new [`Mix`](/type/Mix).
  
  ```raku
  say <a b c> (+) (a => 2.5, b => 3.14).Mix; # OUTPUT: «Mix(a(3.5) b(4.14) c)␤»
  
  ```
  
  ## [infix `(-)`, infix `∖`](#Operators "go to top of document")[§](#infix_(-),_infix_∖ "direct link")
  
  ```raku
  multi infix:<(-)>(**@p)
  ```
  
  Set difference operator.
  
  Returns the **set difference** of all its arguments. This creates a new [`Set`](/type/Set) that contains all the elements the first argument has but the rest of the arguments don't, i.e., of all the elements of the first argument, minus the elements from the other arguments. But only if none of the arguments are a [`Bag`](/type/Bag), [`BagHash`](/type/BagHash), [`Mix`](/type/Mix) or [`MixHash`](/type/MixHash).
  
  ```raku
  say <a a b c a d> (-) <a a b c c>; # OUTPUT: «Set(d)␤»
  say <a b c d e> (-) <a b c> (-) <a b d>; # OUTPUT: «Set(e)␤»
  
  ```
  
  If any of the arguments are [`Baggy`](/type/Baggy) or [`Mixy`](/type/Mixy), the result is a new [`Bag`](/type/Bag) (or [`Mix`](/type/Mix)) containing all the elements remaining after the first argument with its weight subtracted by the weight of that element in each of the other arguments.
  
  ```raku
  say <a a b c a d> (-) bag(<a b c c>); # OUTPUT: «Bag(a(2) d)␤»
  say <a a b c a d>  ∖  mix(<a b c c>); # OUTPUT: «Mix(a(2) c(-1) d)␤»
  
  ```
  
  ## [infix `^`](#Operators "go to top of document")[§](#infix_^ "direct link")
  
  ```raku
  multi infix:<^>($a, $b --> Junction:D) is assoc<list>
  ```
  
  One junction operator.
  
  Creates a *one* [`Junction`](/type/Junction) from its arguments. See [`Junction`](/type/Junction) for more details.
  
  ## [infix `(^)`, infix `⊖`](#Operators "go to top of document")[§](#infix_(^),_infix_⊖ "direct link")
  
  ```raku
  multi infix:<(^)>($a, $b)
  multi infix:<(^)>(**@p)
  ```
  
  Symmetric set difference operator.
  
  Returns the **symmetric set difference** of all its arguments. This creates a new [`Set`](/type/Set) made up of all the elements that `$a` has but `$b` doesn't and all the elements `$b` has but `$a` doesn't if none of the arguments are a [`Bag`](/type/Bag), [`BagHash`](/type/BagHash), [`Mix`](/type/Mix) or [`MixHash`](/type/MixHash). Equivalent to `($a ∖ $b) ∪ ($b ∖ $a)`.
  
  ```raku
  say <a b> (^) <b c>; # OUTPUT: «Set(a c)␤»
  
  ```
  
  If any of the arguments are [`Baggy`](/type/Baggy) or [`Mixy`](/type/Mixy), the result is a new [`Bag`](/type/Bag) (or [`Mix`](/type/Mix)).
  
  ```raku
  say <a b> ⊖ bag(<b c>); # OUTPUT: «Bag(a c)␤»
  
  ```
  
  # [Named unary precedence](#Operators "go to top of document")[§](#Named_unary_precedence "direct link")
  
  ## [prefix `temp`](#Operators "go to top of document")[§](#prefix_temp "direct link")
  
  ```raku
  sub prefix:<temp>(Mu $a is rw)
  ```
  
  "temporizes" the variable passed as the argument. The variable begins with the same value as it had in the outer scope, but can be assigned new values in this scope. Upon exiting the scope, the variable will be restored to its original value.
  
  ```raku
  my $a = "three";
  say $a; # OUTPUT: «three␤»
  {
      temp $a;
      say $a; # OUTPUT: «three␤»
      $a = "four";
      say $a; # OUTPUT: «four␤»
  }
  say $a; # OUTPUT: «three␤»
  ```
  
  You can also assign immediately as part of the call to temp:
  
  ```raku
  temp $a = "five";
  
  ```
  
  Be warned the `temp` effects get removed once the block is left. If you were to access the value from, say, within a [`Promise`](/type/Promise) after the `temp` was undone, you'd get the original value, not the `temp` one:
  
  ```raku
  my $v = "original";
  {
      temp $v = "new one";
      start {
          say "[PROMISE] Value before block is left: `$v`";
          sleep 1;
          say "[PROMISE] Block was left while we slept; value is now `$v`";
      }
      sleep ½;
      say "About to leave the block; value is `$v`";
  }
  say "Left the block; value is now `$v`";
  sleep 2;
  
  # OUTPUT:
  # [PROMISE] Value before block is left: `new one`
  # About to leave the block; value is `new one`
  # Left the block; value is now `original`
  # [PROMISE] Block was left while we slept; value is now `original`
  
  ```
  
  ## [prefix `let`](#Operators "go to top of document")[§](#prefix_let "direct link")
  
  ```raku
  sub prefix:<let>(Mu $a is rw)
  ```
  
  Refers to a variable in an outer scope whose value will be restored if the block exits unsuccessfully, implying that the block returned a defined object.
  
  ```raku
  my $name = "Jane Doe";
  
  {
      let $name = prompt("Say your name ");
      die if !$name;
      CATCH {
          default { say "No name entered" }
      }
      say "We have $name";
  }
  
  say "We got $name";
  
  ```
  
  This code provides a default name for `$name`. If the user exits from the prompt or simply does not provide a valid input for `$name`; `let` will restore the default value provided at the top. If user input is valid, it will keep that.
  
  # [Nonchaining binary precedence](#Operators "go to top of document")[§](#Nonchaining_binary_precedence "direct link")
  
  ## [infix `does`](#Operators "go to top of document")[§](#infix_does "direct link")
  
  ```raku
  sub infix:<does>(Mu $obj, Mu $role) is assoc<non>
  ```
  
  Mixes `$role` into `$obj` at runtime. Requires `$obj` to be mutable.
  
  Similar to [but](/routine/but) operator, if `$role` supplies exactly one attribute, an initializer can be passed in parentheses.
  
  Similar to [but](/routine/but) operator, the `$role` can instead be an instantiated object, in which case, the operator will create a role for you automatically. The role will contain a single method named the same as `$obj.^name` and that returns `$obj`:
  
  ```raku
  my $o = class { method Str { "original" } }.new;
  put $o;            # OUTPUT: «original␤»
  $o does "modded";
  put $o;            # OUTPUT: «modded␤»
  ```
  
  If methods of the same name are present already, the last mixed in role takes precedence.
  
  ## [infix `but`](#Operators "go to top of document")[§](#infix_but "direct link")
  
  ```raku
  multi infix:<but>(Mu $obj1, Mu   $role) is assoc<non>
  multi infix:<but>(Mu $obj1, Mu:D $obj2) is assoc<non>
  ```
  
  Creates a copy of `$obj` with `$role` mixed in. Since `$obj` is not modified, `but` can be used to create immutable values with mixins.
  
  If `$role` supplies exactly one attribute, an initializer can be passed in parentheses:
  
  ```raku
  role Answerable {
      has $.answer;
  }
  my $ultimate-question = 'Life, the Universe and Everything' but Answerable(42);
  say $ultimate-question;         # OUTPUT: «Life, the Universe and Everything␤»
  say $ultimate-question.^name;   # OUTPUT: «Str+{Answerable}␤»
  say $ultimate-question.answer;  # OUTPUT: «42␤»
  
  ```
  
  Instead of a role, you can provide an instantiated object. In this case, the operator will create a role for you automatically. The role will contain a single method named the same as `$obj.^name` and that returns `$obj`:
  
  ```raku
  my $forty-two = 42 but 'forty two';
  say $forty-two+33;    # OUTPUT: «75␤»
  say $forty-two.^name; # OUTPUT: «Int+{<anon|1>}␤»
  say $forty-two.Str;   # OUTPUT: «forty two␤»
  
  ```
  
  Calling `^name` shows that the variable is an [`Int`](/type/Int) with an anonymous object mixed in. However, that object is of type [`Str`](/type/Str), so the variable, through the mixin, is endowed with a method with that name, which is what we use in the last sentence.
  
  We can also mixin classes, even created on the fly.
  
  ```raku
  my $s = 12 but class Warbles { method hi { 'hello' } }.new;
  say $s.Warbles.hi;    # OUTPUT: «hello␤»
  say $s + 42;          # OUTPUT: «54␤»
  
  ```
  
  To access the mixed-in class, as above, we use the class name as is shown in the second sentence. If methods of the same name are present already, the last mixed in role takes precedence. A list of methods can be provided in parentheses separated by comma. In this case conflicts will be reported at runtime.
  
  ## [infix `cmp`](#Operators "go to top of document")[§](#infix_cmp "direct link")
  
  ```raku
  multi infix:<cmp>(Any,       Any)
  multi infix:<cmp>(Real:D,    Real:D)
  multi infix:<cmp>(Str:D,     Str:D)
  multi infix:<cmp>(Version:D, Version:D)
  ```
  
  Generic, "smart" three-way comparator.
  
  Compares strings with string semantics, numbers with number semantics, [`Pair`](/type/Pair) objects first by key and then by value etc.
  
  if `$a eqv $b`, then `$a cmp $b` always returns `Order::Same`.
  
  ```raku
  say (a => 3) cmp (a => 4);   # OUTPUT: «Less␤»
  say 4        cmp 4.0;        # OUTPUT: «Same␤»
  say 'b'      cmp 'a';        # OUTPUT: «More␤»
  ```
  
  Strings are compared codepoint by codepoint; if leading codepoints are the same, the result of comparing the first differing codepoint is returned or the longer string if their lengths differ.
  
  ```raku
  "abcd" cmp "abcde";    # OUTPUT: «Less␤»
  "abcd " cmp "abcde";   # OUTPUT: «Less␤»
  'A' cmp 'Ẳ';           # OUTPUT: «Less␤»
  ```
  
  ## [infix `coll`](#Operators "go to top of document")[§](#infix_coll "direct link")
  
  ```raku
  multi infix:<coll>(Str:D \a, Str:D \b --> Order:D)
  multi infix:<coll>(Cool:D \a, Cool:D \b --> Order:D)
  multi infix:<coll>(Pair:D \a, Pair:D \b --> Order:D)
  ```
  
  `coll` is a sorting operator that takes pairs of [`Str`](/type/Str)s, [`Cool`](/type/Cool)s or [`Pair`](/type/Pair)s and returns an [`Order`](/type/Order) that uses the `$*COLLATION` order. The default behavior disregards diacritic marks and capitalization, for instance.
  
  ```raku
  say "b" cmp "à";  # OUTPUT: «Less␤»
  say "b" coll "à"; # OUTPUT: «More␤»
  ```
  
  In the first case, lexicographic or codepoint order is taken into account. In the second, which uses `coll`, the diacritic is not considered and sorting happens according to intuitive order.
  
  **NOTE:** These are not yet implemented in the JVM.
  
  ## [infix `unicmp`](#Operators "go to top of document")[§](#infix_unicmp "direct link")
  
  ```raku
  multi infix:<unicmp>(Str:D \a, Str:D \b --> Order:D)
  multi infix:<unicmp>(Pair:D \a, Pair:D \b --> Order:D)
  multi infix:<coll>(Pair:D \a, Pair: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.
  
  ```raku
  say 'a' unicmp 'Z'; # OUTPUT: «Less␤»
  say 'a' coll 'Z';   # OUTPUT: «Less␤»
  say 'a' cmp 'Z';    # OUTPUT: «More␤»
  ```
  
  The main difference between `coll` and `unicmp` is that the behavior of the former can be changed by the [`$*COLLATION`](/language/variables#index-entry-%24*COLLATION) dynamic variable.
  
  **NOTE:** These are not yet implemented in the JVM.
  
  ## [infix `leg`](#Operators "go to top of document")[§](#infix_leg "direct link")
  
  ```raku
  multi infix:<leg>(Any,   Any)
  multi infix:<leg>(Str:D, Str:D)
  ```
  
  String three-way comparator. Short for *less, equal or greater?*.
  
  Coerces both arguments to [`Str`](/type/Str) and then does a lexicographic comparison.
  
  ```raku
  say 'a' leg 'b';       # OUTPUT: «Less␤»
  say 'a' leg 'a';       # OUTPUT: «Same␤»
  say 'b' leg 'a';       # OUTPUT: «More␤»
  ```
  
  ## [infix `<=>`](#Operators "go to top of document")[§](#infix_<=> "direct link")
  
  ```raku
  multi infix:«<=>»($a, $b --> Order:D) is assoc<non>
  ```
  
  Numeric three-way comparator.
  
  Coerces both arguments to [`Real`](/type/Real) and then does a numeric comparison.
  
  ## [infix `..`](#Operators "go to top of document")[§](#infix_.. "direct link")
  
  ```raku
  multi infix:<..>($a, $b --> Range:D) is assoc<non>
  ```
  
  Range operator
  
  Constructs a [`Range`](/type/Range) from the arguments.
  
  ## [infix `..^`](#Operators "go to top of document")[§](#infix_..^ "direct link")
  
  ```raku
  multi infix:<..^>($a, $b --> Range:D) is assoc<non>
  ```
  
  Right-open range operator.
  
  Constructs a [`Range`](/type/Range) from the arguments, excluding the end point.
  
  ## [infix `^..`](#Operators "go to top of document")[§](#infix_^.. "direct link")
  
  ```raku
  multi infix:<^..>($a, $b --> Range:D) is assoc<non>
  ```
  
  Left-open range operator.
  
  Constructs a [`Range`](/type/Range) from the arguments, excluding the start point.
  
  ## [infix `^..^`](#Operators "go to top of document")[§](#infix_^..^ "direct link")
  
  ```raku
  multi infix:<^..^>($a, $b --> Range:D) is assoc<non>
  ```
  
  Open range operator.
  
  Constructs a [`Range`](/type/Range) from the arguments, excluding both start and end point.
  
  # [Chaining binary precedence](#Operators "go to top of document")[§](#Chaining_binary_precedence "direct link")
  
  ## [infix `==`, infix `⩵`](#Operators "go to top of document")[§](#infix_==,_infix_⩵ "direct link")
  
  ```raku
  multi infix:<==>(Any, Any)
  multi infix:<==>(Int:D, Int:D)
  multi infix:<==>(Num:D, Num:D)
  multi infix:<==>(Rational:D, Rational:D)
  multi infix:<==>(Real:D, Real:D)
  multi infix:<==>(Complex:D, Complex:D)
  multi infix:<==>(Numeric:D, Numeric:D)
  ```
  
  Numeric equality operator.
  
  Coerces both arguments to [`Numeric`](/type/Numeric) (if necessary); returns `True` if they are equal.
  
  Since Rakudo version 2021.07, ⩵ is an alias for this operator.
  
  ## [infix `!=`, infix `≠`](#Operators "go to top of document")[§](#infix_!=,_infix_≠ "direct link")
  
  ```raku
  sub infix:<!=>(Mu, Mu --> Bool:D)
  ```
  
  Numeric inequality operator.
  
  Coerces both arguments to [`Numeric`](/type/Numeric) (if necessary); returns `True` if they are distinct.
  
  Is equivalent to `!==`.
  
  ## [infix `<`](#Operators "go to top of document")[§](#infix_< "direct link")
  
  ```raku
  multi infix:«<»(Int:D, Int:D)
  multi infix:«<»(Num:D, Num:D)
  multi infix:«<»(Real:D, Real:D)
  ```
  
  Numeric less than operator.
  
  Coerces both arguments to [`Real`](/type/Real) (if necessary); returns `True` if the first argument is smaller than the second.
  
  ## [infix `<=`, infix `≤`](#Operators "go to top of document")[§](#infix_<=,_infix_≤ "direct link")
  
  ```raku
  multi infix:«<=»(Int:D, Int:D)
  multi infix:«<=»(Num:D, Num:D)
  multi infix:«<=»(Real:D, Real:D)
  ```
  
  Numeric less than or equal to operator.
  
  Coerces both arguments to [`Real`](/type/Real) (if necessary); returns `True` if the first argument is smaller than or equal to the second.
  
  ## [infix `>`](#Operators "go to top of document")[§](#infix_> "direct link")
  
  ```raku
  multi infix:«>»(Int:D, Int:D)
  multi infix:«>»(Num:D, Num:D)
  multi infix:«>»(Real:D, Real:D)
  ```
  
  Numeric greater than operator.
  
  Coerces both arguments to [`Real`](/type/Real) (if necessary); returns `True` if the first argument is larger than the second.
  
  ## [infix `>=`, infix `≥`](#Operators "go to top of document")[§](#infix_>=,_infix_≥ "direct link")
  
  ```raku
  multi infix:«>=»(Int:D, Int:D)
  multi infix:«>=»(Num:D, Num:D)
  multi infix:«>=»(Real:D, Real:D)
  ```
  
  Numeric greater than or equal to operator.
  
  Coerces both arguments to [`Real`](/type/Real) (if necessary); returns `True` if the first argument is larger than or equal to the second.
  
  ## [infix `eq`](#Operators "go to top of document")[§](#infix_eq "direct link")
  
  ```raku
  multi infix:<eq>(Any,   Any)
  multi infix:<eq>(Str:D, Str:D)
  ```
  
  String equality operator.
  
  Coerces both arguments to [`Str`](/type/Str) (if necessary); returns `True` if both are equal.
  
  Mnemonic: *equal*
  
  ## [infix `ne`](#Operators "go to top of document")[§](#infix_ne "direct link")
  
  ```raku
  multi