http://qs321.pair.com?node_id=11133562


in reply to Re^2: [Raku] Ranges in array slices
in thread [Raku] Ranges in array slices

Functionally you can express all Ranges as Sequences, albeit that'd be slower methinks. What you're asking is a bit like asking why we need multiplication if we can just keep adding.

Check out the documentation. Range, just like List does Positional and Iterable roles. Seq only does Iterable and implements the indexing (AT-POS method et. al) itself, specifically a Seq always has to calculate all n-1 elements before you can access the n-th element.


holli

You can lead your users to water, but alas, you cannot drown them.