blob: cf34f2461a80375012ea462f31dc8794d469f1b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#*
* Examples of how to use arrays
*#
# Create a function bar, returns 0 by default
func bar { say "bar" }
# Create a multi dimensional array foo
my foo = [bar, 1, 4/2, double "3", ["A", ["BA", "BB"]]];
# Run on each element of foo recursive 'say'
say foo;
# Print the length of the array
assert 5 == say len foo;
# Print the last index of the array
assert 4 == say ind foo;
|