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

> I think you mean linked-list here

Yes, I specified this explicitly, e.g. "The Zipper acts like a linked-list with a cursor" and "Where [a, b, c] denotes a singly-linked list".

> Parent is talking about "arrays"

You're using quotation marks, but I don't see what you're quoting? The parent explicitly says: "a list and an index"

In any case, arrays come with most of the same problems I mentioned for lists:

- They have invalid states, e.g. ([], 42)

- They require bounds-checking, a consistent notion of subtraction on the index type, etc.

- They can't be infinite

- They require O(N) time, O(N) memory (and O(N) garbage if we're discarding the old value) to replace the focused element

- etc.

Plus, arrays come with all sorts of extra gotchas, like buffer-overflows, pre-allocation/re-allocation decisions, over/under-provisioning, etc.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: