txt: ## bind-pos.md
  BIND-POS
  
  Combined from primary sources listed below.
  
  # [In IterationBuffer](#___top "go to top of document")[§](#(IterationBuffer)_method_BIND-POS "direct link")
  
  See primary documentation
  [in context](/type/IterationBuffer#method_BIND-POS)
  for **method BIND-POS**.
  
  ```raku
  multi method BIND-POS(IterationBuffer:D: int   $pos, Mu \value)
  multi method BIND-POS(IterationBuffer:D: Int:D $pos, Mu \value)
  ```
  
  Binds the given value at the given element position and returns it. The `IterationBuffer` is automatically lengthened if the given element position is beyond the length of the `IterationBuffer`. An error indicating the index is out of bounds will be thrown for negative position values.
  
  # [In Subscripts](#___top "go to top of document")[§](#(Subscripts)_method_BIND-POS "direct link")
  
  See primary documentation
  [in context](/language/subscripts#method_BIND-POS)
  for **method BIND-POS**.
  
  ```raku
  multi method BIND-POS (::?CLASS:D: $index, \new)
  ```
  
  Expected to bind the value or container `new` to the slot at position `$index`, replacing any container that would be naturally found there. This is what is called when you write:
  
  ```raku
  my $x = 10;
  @numbers[5] := $x;
  
  ```
  
  The generic [`Array`](/type/Array) class supports this in order to allow building complex linked data structures, but for more domain-specific types it may not make sense, so don't feel compelled to implement it. If you don't, users will get an appropriate error message when they try to bind to a positional slot of an object of this type.
  