txt: ## defined.md
  defined
  
  Combined from primary sources listed below.
  
  # [In Mu](#___top "go to top of document")[§](#(Mu)_method_defined "direct link")
  
  See primary documentation
  [in context](/type/Mu#method_defined)
  for **method defined**.
  
  ```raku
  multi method defined(   --> Bool:D)
  ```
  
  Returns `False` on a type object, and `True` otherwise.
  
  ```raku
  say Int.defined;                # OUTPUT: «False␤»
  say 42.defined;                 # OUTPUT: «True␤»
  ```
  
  A few types (like [`Failure`](/type/Failure)) override `defined` to return `False` even for instances:
  
  ```raku
  sub fails() { fail 'oh noe' };
  say fails().defined;            # OUTPUT: «False␤»
  ```
  
  # [In Mu](#___top "go to top of document")[§](#(Mu)_routine_defined "direct link")
  
  See primary documentation
  [in context](/type/Mu#routine_defined)
  for **routine defined**.
  
  ```raku
  multi defined(Mu --> Bool:D)
  ```
  
  invokes the `.defined` method on the object and returns its result.
  
  # [In Failure](#___top "go to top of document")[§](#(Failure)_method_defined "direct link")
  
  See primary documentation
  [in context](/type/Failure#method_defined)
  for **method defined**.
  
  ```raku
  multi method defined(Failure:D: --> Bool:D)
  ```
  
  Returns `False` (failures are officially undefined), and marks the failure as handled.
  
  ```raku
  sub f() { fail };
  my $v = f;
  say $v.handled; # OUTPUT: «False␤»
  say $v.defined; # OUTPUT: «False␤»
  say $v.handled; # OUTPUT: «True␤»
  ```
  
  # [In Junction](#___top "go to top of document")[§](#(Junction)_method_defined "direct link")
  
  See primary documentation
  [in context](/type/Junction#method_defined)
  for **method defined**.
  
  ```raku
  multi method defined(Junction:D:)
  ```
  
  Checks for definedness instead of Boolean values.
  
  ```raku
  say ( 3 | Str).defined ;   # OUTPUT: «True␤»
  say (one 3, Str).defined;  # OUTPUT: «True␤»
  say (none 3, Str).defined; # OUTPUT: «False␤»
  ```
  
  [`Failure`](/type/Failure)s are also considered non-defined:
  
  ```raku
  my $foo=Failure.new;
  say (one 3, $foo).defined; # OUTPUT: «True␤»
  ```
  
  Since 6.d, this method will autothread.
  