Hacker News new | past | comments | ask | show | jobs | submit login

I believe the paper handles this case with the LastUsed offset in the implementation of cons.

> During the consing of (9) the pointer offset is compared with the last used offset, LastUsed. If it is the same and less than the block size then it is simply incremented, the new entry made and LastUsed updated. This would have occurred as the integers (6), (7), (8) were added. If on the other-hand the pointer offset is less than the LastUsed a cons is being applied to the tail of a longer list, as is the case with the (9). In this case a new list block must be allocated and its Base-Offset pointer set to the tail contained in the original list.

If I'm understanding correctly, cells are only mutated in place if they are not the tails of other lists (meaning they aren't shared). If the cell is already the tail of another list, the consing is accomplished by creating a new cell to avoid modifying the other list.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: