3 ms·
How 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.
by KallDrexx 10y ago
How 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'"