(subarray: $a, 3, 4) is the same as
You can obtain subarrays of arrays without this macro, by using the
of syntax along
with an array of positions. For instance,
$a's (range:4,12) obtains a subarray of $a containing
its 4th through 12th values. But, for compatibility with previous Harlowe versions which did not
feature this syntax, this macro also exists.
If you provide negative numbers, they will be treated as being offset from the end
of the array -
-2 will specify the
2ndlast item, just as 2 will specify
If the last number given is larger than the first (for instance, in
(subarray: (a:1,2,3,4), 4, 2))
then the macro will still work - in that case returning (a:2,3,4) as if the numbers were in
the correct order.