Slicing and infinity
> my @words = < orange lime cherry banana lemon >; > say @words[0,4,2]; orange lemon cherry > say @words[3..7]; # slice beyond the end of the list banana lemon Any() Any() Any() > say @words[3..Inf]; # now what...? > say @words[3..*]; # now what...?
If a subscript is "known infinite", then slicing does an "autotrim" operation that stops at the first index beyond the end.
> say @words[3..*]; banana lemon @words[3..7] # always 5 elements @words[3..*] # autotrims to @words.elems