You are right - a negative number in a range mainly refers to the end of the list, not to the beginning. -x equivalent to who.length()-x .
What you are dealing with is known as fragments in Python. (I mention terminology because searching for something like “groovy slices” can help you find more information, although I don’t know if they are really called “slices” in relation to Groovy.) You can find more information about this syntax feature here .
For other resources, I found Groovy's book in action quite useful for learning Groovy.
source share