4 ms·
Why do you want an array? You mean you want a memory area with adjacent cells layed out, to talk to C perhaps? Perhaps might want a list, a binary, or a sorted
by rdtsc 10y ago
Why do you want an array? You mean you want a memory area with adjacent cells layed out, to talk to C perhaps? Perhaps might want a list, a binary, or a sorted set, a tuple, a map and so on. You have to tell a bit more about your use case.
I used Erlang for many years, and in the last one full time. Not one time have I needed an "array". It seems you picked one odd feature no-one uses and are upset about it, I thik it is just a small misunderstand, if you share a bit more about what you are trying to do, you'll get more help.
> I just find this disappointing
Did you explain your use case to them. If you just said "I need an array" I see their response as perfectly rational. And from what I've seen, that is probably the friendliest and most approachable community, especially for newcomers.
- cutler 10y agoI would need an array for processing any large data set as an indexed collection. Why is that considered an "odd feature no-one uses" when it's a fundamental data type in most mainstream languages?
- KallDrexx 10y agoHow are you planning on accessing it though? If it's iterated over sequentially then a list works perfectly. If it's random access then a map works.
- cutler 10y agoWhat if I want to push/pop it and also access it randomly by index? PHP gets a lot of stick for making arrays serve double purpose but the Elixir advocates of using maps for array purposes are basically arguing for the same thing, no?
- kccqzy 10y agoLooks like you want a finger tree.
- di4na 10y agoThen you are not in functional programming place anymore, and you may want to use an imperative language. I think it is John Hughes that said "The real question is not 'when should i use functional programming?' but 'when should i use imperative programming?' And the answer is 'When you need random access and complete control of your memory'"