Some interesting examples on how the writing and the erasing are almost one.
Is one allowed to dress a child in their pajamas on Shabbos even though they are not going to sleep until after Shabbos;
photo albums, loose book binding, etc.