4 ms·
In all your replies, you haven't given concrete example of "I need arrays because tuples or lists can't do X". Complaining in the abstract isn't helpful. If E
by tbrooks 10y ago
In all your replies, you haven't given concrete example of "I need arrays because tuples or lists can't do X".
Complaining in the abstract isn't helpful.
If Elixir had arrays, why would that be better than using other enumerables like lists or tuples?
- cutler 10y agoIt would be better because lists are not accessible by index and tuples are only designed for small amounts of data.
- frigo_1337 10y ago...but why do you want to access it by index? Since you refuse to be more specific, it sounds like you're just not willing to learn the language and the way problems are solved with it. Expecting mutable C-type arrays in elixir/erlang is like expecting classes and lambdas in an assembly language. It's just not a good fit for what the language was designed to do.
- alehander42 10y agonot the OP, but I've had a side project in Elixir and often I wanted to browse/play with some of the last saved models in repl. When I get the collection using `ecto`'s `Repo.all..` I can't just `bets[4]` or `bets[-2]`, I have to do weird gymnastics like `hd(tl(bets |> Enum.reverse))`
- smss79 10y agohttp://elixir-lang.org/docs/stable/elixir/Enum.html#at/3 http://elixir-lang.org/docs/stable/elixir/Enum.html#at/3
- alehander42 10y agothank you!