06 Jan 2014, 15:35
Generic-user-small

Federico Tomassetti (3 posts)

Hi, reading the book I wonder how could I represent random access structures (I am thinking about a bidimensional matrix but the same apply to vectors). Lists are good for sequential access but terrible for the rest. Maybe I could use dicts (am I not restricted to keywords for keys, anyway?) but it does not feel right for large chuncks of data

07 Jan 2014, 05:08
Dave_gnome_head_isolated_pragsmall

Dave Thomas (337 posts)

If the size is fixed, you could use tuples or tuples, so a 2x2 matrix could be

{ {1, 2}, {3, 4}}

Otherwise, I suspect you’ll be struggling.

Dave

29 Jan 2014, 22:53
Generic-user-small

Federico Tomassetti (3 posts)

Well, i am thinking abou a world map, reasonably a 512x512 matrix. So it would be really important to have random acess. Maybe this is not the best scenario for something like Elixir, which gives its best a stream data processing

  You must be logged in to comment