i can see why it might not exist because it could ...
# announcements
h
i can see why it might not exist because it could be conflated with
subList
since they both take two `Int`s as params.
It's just a more pragmatic approach to sublists in the context of vectors
vectors are basically arrays, but mathematically they are determined by a point, an angle, and a length, and so operations on them in math are based on that length. so a vector class would be like a list, but its contents would be generated based on a variable length, and you wouldn't be able to alter the contents therein directly. In a perfect world where truly immutable collections existed
so if you're doing operations with vectors and you just want to perform arithmetic with a portion of an existing vector, you could use
subVector
, as I proposed instead of constantly instantiating new objects.
that's the thought process at least
yeah, there's always been a clash between programming syntax and mathematical syntax
you're right!