Vyxapedia

Element - - Insert

Characters:


Description

Insert a value at a specified index / Map a function over every nth item of a list


Overloads

  • any-num-any - a.insert(b,c) (insert c at position b in a)
  • any-num-fun - c mapped over every bth item of a ([c(v) if i%b==0 else v for i,v in enumerate(a)])

Examples

  • ⟨1|3|4⟩ 1 2 Ṁ = ⟨1|2|3|4⟩
  • 134 1 2 Ṁ = 1234
  • ⟨1|3|4⟩ -1 2 Ṁ = ⟨1|3|4|2⟩
  • ⟨1|3|4⟩ 1.9 2 Ṁ = ⟨1|2|3|4⟩
  • `wyz` 1 `x` Ṁ = `wxyz`
  • `jknop` 2 `lm` Ṁ = `jklmnop`