3 ms·
In Erlang, lists are linked lists. The fact that tuples are stored in memory sequentially is a major difference from lists.
by AlchemistCamp 7y ago
In Erlang, lists are linked lists. The fact that tuples are stored in memory sequentially is a major difference from lists.
- lpil 7y agoWhat data structure would you think of when you hear just "list"?
- qppo 7y agoList is an access pattern, like a queue or deque. Linked lists are a data representation using a couple of pointers. It's like the difference between a graph and an adjacency list or matrix. A list being a linked list is an implementation detail. At least to me. Mostly because linked lists are in general, awful ways to store data.
- lpil 7y agoIt depends on what you want to do with them. They have constant time prepending and support structural sharing, both highly desirable features in many use cases.