3 ms·
You want tuples. They've got index-based access, and all your useful things in erlang:element/2, setelement/3, append_element/3, delete_element/2, insert_elemen
by toast0 3y ago
You want tuples. They've got index-based access, and all your useful things in erlang:element/2, setelement/3, append_element/3, delete_element/2, insert_element/3.
With a big caveat that modifying tuples isn't great for performance unless the compiler or optimizer determine that mutating the tuple is acceptable rather than providing a mutated copy.
- cutler 3y agoI understood tuples are only optimised for a handful of elements.
- throwawaymaths 3y agoThis is correct. If you want a true array experience you have to use atomics or a nif.