Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the closest thing in Erlang to hashes?

What I wanted was a way to pass arguments into functions which resembled a ruby hash map. Although maybe this is a bad fit for Erlang, I'm not sure yet

In Ruby I often used hashes like:

{"a"=>100, "b"=>200}

: What is the closest thing in Erlang?

Update: I have since found this:

http://20bits.com/articles/erlang-an-introduction-to-records/

Is using records a good candidate?

like image 541
yazz.com Avatar asked Feb 22 '10 14:02

yazz.com


2 Answers

proplists, dicts, or gb_trees.

like image 87
Zed Avatar answered Oct 14 '22 08:10

Zed


Erlang R17A will include map data structure.

like image 35
Majid Azimi Avatar answered Oct 14 '22 08:10

Majid Azimi