3 ms·
It's the other way around, actually. If you define a map as a list, it will have none of the properties of a map: you can't lookup a key in constant time. But
by brabel 6y ago
It's the other way around, actually. If you define a map as a list, it will have none of the properties of a map: you can't lookup a key in constant time.
But if you start with maps, then you can represent a list as a special case of a map in which the keys are integers that get incremented, starting at 0.
- Reelin 6y agoGP isn't talking about the runtime implementation but rather the serialization format. You can serialize a map as a list. Therefore, a hypothetical Lisp-like language based around maps could simply end up consisting of lists that contain key value pairs.