Re:Rails 5.0: Action Cable, API mode, and more
by cutler on Thursday June 30, 2016 @09:26PM
(#12013237)
I have studied Elixir and other functional languages such as Clojure where vectors are 1 of the 3 basic collection types so the "new way of doing things" isn't an issue for me. Elixir took a lot of inspiration from Clojure so the 2 languages are not that different.
[ Parent
| on HN ]
Re:Rails 5.0: Action Cable, API mode, and more
by nine_k on Thursday June 30, 2016 @11:06PM
(#12013640)
Expectedly, per Clojure documentation, "Vectors support access to items by index in log32N hops". This means that a Clojure vector is essentially a tree-based map; a "true" array (as in C or Java) would have O(1) time for access by index.
I suspect that Elixir's maps are not different in this regard, as are Erlang's arrays, or maps in Haskell or OCaml. This is the canonical way to make an immutable map (see picture here: http://programmers.stackexchange.com/questions/195718/functi...).