Again….underlying implementation was never the issue. The operations in the List API are the issue.
To clarify one last time (and this is the last for me) — the Elixir API provides these operations on a List which result in a list being returned which may be different from the original list (i.e. it . - prepend element (via operator) - delete element - delete element at any index - flatten - flatten with tail (which happens to append the tail to the end of the list) - fold left - fold right - insert element at any index - key delete - key replace - key store - replace element at any index - concatenate list (via operator) http://elixir-lang.org/docs/stable/elixir/List.html#summary <http://elixir-lang.org/docs/stable/elixir/List.html#summary> All in Elixir is immutable. That’s been understood from the beginning…from the first day I picked up Elixir. That was never the subject of this thread. I did use the word “mutability” — that was not referring to whether in its implementation the Elixir list data type itself could be changed. That was referring to the nature of the operations mentioned above, exposed on the Elixir List API, which give you the logical ability to start with a List which looks like X, and via one of the operations above, be handed back a List which looks like Y. If you are going to make the argument that my use of “mutability” was misused because the operations above return a new list, then all of the operations in the List API are misnamed, because they neither “delete element” or “insert element” or whatever technically either — they produce a new list (which wouldn’t be deleting or inserting or replacing either)— they would all be wrong on the basis of this immutability too. So if that’s your take, you need to go to the dev list and raise the issue of the above methods being improperly named, because they don’t do what they say either. That’s not my view, because I can separate API from implementation, but if you choose to raise the contention, then be consistent — your grievance exists in the entire existing List API. Looking at the list of operations above, I don’t know how anyone can argue with a straight face that “append” element doesn’t belong. But that’s not the view of others….that’s fine, agree to disagree. Doc it to help those who will be confused by the pretty obvious omission when they look for append in the List API. That’s better than nothing. That’s it for me. B > On Jun 18, 2016, at 1:54 PM, Redvers Davies <[email protected]> wrote: > > Bradley, > > You said: > > "I find it completely absurd to have an ordered data structure API which > allows mutability but doesn’t formally allow and express adding elements in > order." > > You explicitly said mutable. A clarification that there are no mutable > data-structures on the beam seems an appropriate clarification. -- You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/B45106A7-73ED-4368-A084-6FB7845973E3%40bighillsoftware.com. For more options, visit https://groups.google.com/d/optout.
