Data

Arrays

Typed lists. Create them empty or already dressed, then grow and shrink them with push and pop.

Create

define num[] numbers is [10, 20, 30];
define num[] history is [];

Read and write an index

Zero-based. The first seat is 0. I did not invent this, I just inherited it.

showln numbers[3];
redefine history[0] is 100;

length

showln length numbers;
showln arr[length arr - 1];

Reference: length.

push / with / pop

push numbers with 40;
pop numbers;

push always takes with — the value has to be introduced. pop removes the last item. Last in, first out, no hard feelings.

Through a function

Passing an array lets the callee push and pop the same list. See arrays & scopes if you want the whole scene.