pop

remove and return the last item from given collection


Parameters

pop collection :literal :pathliteral

Attributes

n:integerremove multiple items. (Must be greater than 0.)

Returns

  • :any

Examples

copy
a: [0 1 2 3 4 5] b: pop 'a inspect a ; [ :block ; 0 :integer ; 1 :integer ; 2 :integer ; 3 :integer ; 4 :integer ; ] inspect b ; 5 :integer b: pop.n: 2 'a inspect a ; [ :block ; 0 :integer ; 1 :integer ; 2 :integer ; ] inspect b ; [ :block ; 3 :integer ; 4 :integer ; ]

copy
a: "Arturoo" b: pop 'a inspect a ; Arturo :string inspect b ; o :char b: pop.n: 3 'a inspect a ; Art :string inspect b ; uro :string

Related