As far as I'm aware Elixir's data structures are basically Erlang data structures. That being so, why doesn't Elixir have arrays like Erlang and nearly every major programming language in use today? It just feels to me like Elixir's missing piece.
gvim
--
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 elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/57072DF9.1030205%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
gvim
--
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 elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/57079051.2060506%40gmail.com.
I think the omission takes something away from Elixir having its own identity. When a new Ruby, Javascript, or Python developer comes to Elixir they could be forgiven for thinking Elixir has a missing data structure. Couldn't array literals simply error when used in pattern matching?
gvim
--
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 elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/5707A5B4.4060700%40gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/5K7IZWODawE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/5707B88E.6050402%40gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/5K7IZWODawE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/5707B88E.6050402%40gmail.com.
--
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 elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/5707BD61.5070306%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/CAOMhEnxcMkvPJoasXVQ_oNWJAUnwjkcCxjS%2Bs4X28mu-%3D37nWQ%40mail.gmail.com.
--
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 elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/5707E402.5010409%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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 elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/5707E402.5010409%40gmail.com.
Yes, I had in mind the type of nested data structure where indexed
access is essential. Maybe that's what it comes down to, then - BEAM's
limitations - in which case I can see how arrays/vectors may not be a
good choice. The NIF option, however, leaves me a bit cold as I've heard
bad things about them in Erlang.
gvim
--
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 elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/8453f2ab-ae9e-4cfa-9a3b-5eba9e87a2af%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/5K7IZWODawE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/CAGnRm4L-FrPhsjARBXMcvJLgegCf7yRGwt-tmYGDz8ZSAyLRFg%40mail.gmail.com.
gvim
--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-talk/5K7IZWODawE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/5709111A.6000804%40gmail.com.
I actually like the idea of %[a, b, c] being shorthand for %{0 => a, 1 => b, 2 => c} and having %[a, b, c][1] == b.
I don't have a strong use case personally, I just think that syntax would gel well with the rest of the language. I suppose a sigil would accomplish that fairly easily.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/CAM6of9ygUqBpQk%3D3Ur17dUOZY_M89bsu4DyFpOrwb5MJPw0PeA%40mail.gmail.com.
So basically a map with integer index keys would serve the same role?
Yes, I appreaciate Python and Ruby use a lot of C for computation so maybe Elixir can also call these languages when something heavier is need. I had a look at ZeroMQ a while back and that looked promising.
So basically a map with integer index keys would serve the same role?Kinda. You still need to answer questions what is the performance of operations like concat, push, pop, shift, unshift. For example, if you add one element at the beginning (unshift), will you have to shuffle all of the indexes? That's not efficient. Then you need to store the offset and the size in the data structure (which is ok but it means it won't be pattern matchable).
--
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 elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/CAGnRm4%2B_La3bYBKFcusmyNr4TF3C2RUq6RwsOXq%2BUBuHz2AxCQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/CAOMhEnw0LZc_%2BK%3DaEyeDYcUvtuZ7FHiiB-1q4DoErbsWUa8WiQ%40mail.gmail.com.