txt: ## whatever.md
  class Whatever
  
  Placeholder for the value of an unspecified argument
  
  ```raku
  class Whatever { }
  ```
  
  `Whatever` is a class whose objects don't have any explicit meaning; it gets its semantics from other routines that accept `Whatever`-objects as markers to do something special. Using the `*` literal as an operand creates a `Whatever` object.
  
  Much of `*`'s charm comes from *Whatever-priming*. When `*` is used in term position, that is, as an operand, in combination with most operators, the compiler will transform the expression into a closure of type [`WhateverCode`](/type/WhateverCode), which is actually a [`Block`](/type/Block) that can be used wherever [`Callable`](/type/Callable)s are accepted.
  
  ```raku
  my $c = * + 2;          # same as   -> $x { $x + 2 };
  say $c(4);              # OUTPUT: «6␤»
  ```
  
  Multiple `*` in one expression generate closures with as many arguments:
  
  ```raku
  my $c = * + *;          # same as   -> $x, $y { $x + $y }
  ```
  
  Using `*` in complex expressions will also generate closures:
  
  ```raku
  my $c = 4 * * + 5;      # same as   -> $x { 4 * $x + 5 }
  ```
  
  Calling a method on `*` also creates a closure:
  
  ```raku
  <a b c>.map: *.uc;      # same as    <a b c>.map: -> $char { $char.uc }
  
  ```
  
  As mentioned before, not all operators and syntactic constructs prime `*` (or `Whatever`-stars) to [`WhateverCode`](/type/WhateverCode). In the following cases, `*` will remain a `Whatever` object.
  
  | Exception | Example | What it does |
  | --- | --- | --- |
  | comma | 1, \*, 2 | generates a List with a \* element |
  | range operators | 1 .. \* | Range from 1 to Inf |
  | series operator | 1 ... \* | infinite lazy Seq |
  | assignment | $x = \* | assign \* to $x |
  | binding | $x := \* | bind \* to $x |
  | list repetition | 1 xx \* | generates an infinite list |
  
  The range operators are handled specially. They do not prime with `Whatever`-stars, but they do prime with [`WhateverCode`](/type/WhateverCode)
  
  ```raku
  say (1..*).^name;       # OUTPUT: «Range␤»
  say ((1..*-1)).^name;   # OUTPUT: «WhateverCode␤»
  ```
  
  This allows all these constructs to work:
  
  ```raku
  .say for 1..*;          # infinite loop
  
  ```
  
  and
  
  ```raku
  my @a = 1..4;
  say @a[0..*];           # OUTPUT: «(1 2 3 4)␤»
  say @a[0..*-2];         # OUTPUT: «(1 2 3)␤»
  ```
  
  Because *Whatever-priming* is a purely syntactic compiler transform, you will get no runtime priming of stored `Whatever`-stars into [`WhateverCode`](/type/WhateverCode)s.
  
  ```raku
  my $x = *;
  $x + 2;   # Not a closure, dies because it can't coerce $x to Numeric
  CATCH { default { put .^name, ': ', .Str } };
  # OUTPUT: «X::Multi::NoMatch: Cannot resolve caller Numeric(Whatever: );
  # none of these signatures match:␤
  # (Mu:U \v: *%_)»
  
  ```
  
  The use cases for stored `Whatever`-stars involve those prime-exception cases mentioned above. For example, if you want an infinite series by default.
  
  ```raku
  my $max    = potential-upper-limit() // *;
  my $series = known-lower-limit() ... $max;
  
  ```
  
  A stored `*` will also result in the generation of a [`WhateverCode`](/type/WhateverCode) in the specific case of smartmatch. Note that this is not actually the stored `*` which is being primed, but rather the `*` on the left-hand side.
  
  ```raku
  my $constraint           = find-constraint() // *;
  my $maybe-always-matcher = * ~~ $constraint;
  
  ```
  
  If this hypothetical `find-constraint` were to have found no constraint, `$maybe-always-matcher` would evaluate to `True` for anything.
  
  ```raku
  $maybe-always-matcher(555);      # True
  $maybe-always-matcher(Any);      # True
  
  ```
  
  [`HyperWhatever`](/type/HyperWhatever)'s functionality is similar to `Whatever`, except it refers to multiple values, instead of a single one.
  
  # [Methods](#class_Whatever "go to top of document")[§](#Methods "direct link")
  
  ## [method ACCEPTS](#class_Whatever "go to top of document")[§](#method_ACCEPTS "direct link")
  
  ```raku
  multi method ACCEPTS(Whatever:D: Mu $other)
  multi method ACCEPTS(Whatever:U: Mu $other)
  ```
  
  If the invocant is [an instance](/language/classtut#A_word_on_types), always returns `True`. If the invocant is a type object, performs a typecheck.
  
  ```raku
  say 42 ~~ (*);       # OUTPUT: «True␤»
  say 42 ~~ Whatever;  # OUTPUT: «False␤»
  ```
  
  ## [method Capture](#class_Whatever "go to top of document")[§](#method_Capture "direct link")
  
  ```raku
  method Capture()
  ```
  
  Throws `X::Cannot::Capture`.
  
  # [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")
  
  Type relations for `Whatever`
  
  
  
  raku-type-graph
  
  
  
  Whatever
  Whatever
  
  
  Any
  Any
  
  
  Whatever->Any
  
  
  
  Mu
  Mu
  
  
  Any->Mu
  
  [Expand chart above](/assets/typegraphs/Whatever.svg)
  