txt: ## count.md
  count
  
  Combined from primary sources listed below.
  
  # [In Signature](#___top "go to top of document")[§](#(Signature)_method_count "direct link")
  
  See primary documentation
  [in context](/type/Signature#method_count)
  for **method count**.
  
  ```raku
  method count(Signature:D: --> Real:D)
  ```
  
  Returns the *maximal* number of positional arguments which can be bound to the signature. Returns `Inf` if there is a slurpy positional parameter.
  
  # [In ForeignCode](#___top "go to top of document")[§](#(ForeignCode)_method_count "direct link")
  
  See primary documentation
  [in context](/type/ForeignCode#method_count)
  for **method count**.
  
  ```raku
  method count()
  ```
  
  Returns the number of arguments the enclosed code needs.
  
  # [In Format](#___top "go to top of document")[§](#(Format)_method_count "direct link")
  
  See primary documentation
  [in context](/type/Format#method_count)
  for **method count**.
  
  ```raku
  method count(--> List:D)
  ```
  
  Returns the **maximal** number of positional arguments that is needed for this format. Intended for introspection purposes.
  
  ```raku
  use v6.e.PREVIEW;
  my $d = Format.new("%05d%3x:%s");
  say $d.count;                   # OUTPUT: «3␤»
  
  ```
  
  # [In Code](#___top "go to top of document")[§](#(Code)_method_count "direct link")
  
  See primary documentation
  [in context](/type/Code#method_count)
  for **method count**.
  
  ```raku
  method count(Code:D: --> Real:D)
  ```
  
  Returns the maximum number of positional arguments that may be passed when calling the code object. For code objects that can accept any number of positional arguments (that is, they have a slurpy parameter), `count` will return `Inf`. Named parameters do not contribute.
  
  ```raku
  sub argless() { }
  sub args($a, $b?) { }
  sub slurpy($a, $b, *@c) { }
  say &argless.count;             # OUTPUT: «0␤»
  say &args.count;                # OUTPUT: «2␤»
  say &slurpy.count;              # OUTPUT: «Inf␤»
  ```
  