Pros of Conses – Lesson learned about lists in Erlang
1–5 of 5 posts
Re: Pros of Conses – Lesson learned about lists in Erlang
#2Re: Pros of Conses – Lesson learned about lists in Erlang
#3It's worth noting this is far from unique to Erlang. Any language that models lists this way (Haskell and Lisp immediately spring to mind, but there's plenty of others) share this property.
Re: Pros of Conses – Lesson learned about lists in Erlang
#4It's worth noting this is far from unique to Erlang. Any language that models lists this way (Haskell and Lisp immediately spring to mind, but there's plenty of others) share this property.
A list is always a linked list, simply of doubly, and that's the name that defines the datastructure. If you want an other complexity for such-and-such operation use another datasctructure. Be it stack, array / vector, tree, trie, …
Lists are lists in C++, Erlang, Haskell, Obj-C, … If one calls a PHP `array()` or a JS `[]` a list, it's not right in the CS sense, but it's correct in the general sense I guess.
But then again, this is something one learns with time.
Re: Pros of Conses – Lesson learned about lists in Erlang
#5It's worth noting this is far from unique to Erlang. Any language that models lists this way (Haskell and Lisp immediately spring to mind, but there's plenty of others) share this property.
What do you mean "lists this way"? A list is always a linked list, simply of doubly, and that's the name that defines the datastructure. If you want an other complexity for such-and-such operation use another datasctructure. Be it stack, array / vector, tree, trie, … Lists are lists in C++, Erlang, Haskell, Obj-C, … If one calls a PHP `array()` or a JS `[]` a list, it's not right in the CS sense, but it's correct in…