posted 16 years ago
the dot operators go left to right. so, the first one is saying
take the current object, get its previous reference, and then take THAT things next reference.
Assuming current points to the nth object, current.previous would give you the (n-1)th object. You then get the next reference from the (n-1)th, which should give you the nth.
your second example is similar. first should point to the 1st object. you then get the reference to the next object, which would give you the 2nd. you then get the previous reference from the 2nd, putting you back at the 1st.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors