Peek reads, play moves
transcript
A shelf keeps recent titles. Play moves a title up. Peek only reads a position. Does peek move it too?
Titles one and two were played. The shelf is two, then one. Rank one is title two. Now peek at title one.
Peek should only read. Then rank one stays title two. A touching peek changes the rank. It also evicts the wrong title.
A real shelf has a fixed size. The oldest title leaves first. Each command must be fast.
Peek is cheap to call. A player calls it all the time. So it must never write.
Only play changes the order. Peek reads a position. Rank reads a title.
Test a peek, then a rank. Test a peek, then a play. Test a title not on the shelf.
A shelf is a promise. Peek must never break it. Say who may change state.
Only play changes the order. Full breakdown in the lecture.