The index after one step. Without loop the sequence clamps at both
ends (stepping past the last returns the last, so a caller can detect
"did not move" by comparing to the input); with it the ends wrap. An
empty sequence has no index to step and returns 0.
The index after one step. Without
loopthe sequence clamps at both ends (stepping past the last returns the last, so a caller can detect "did not move" by comparing to the input); with it the ends wrap. An empty sequence has no index to step and returns 0.