[erlang-questions] Accessing a single value from MAPS

Ivan Carmenates Garcia <>
Wed Oct 7 20:54:55 CEST 2015

Hi everyone,


Dot notation with maps would be very nice.


I am currently using maps in the database layer in my little framework and
still I have to do not handy but very fast I must say, pattern machine
operations to gets the desired values, instead I could use something like


Map.id, . would be nice!! instead of {id:= Id} = Map.



Ivan (son of Gilberio).




[mailto:] On Behalf Of Milton Inostroza
Sent: Sunday, September 6, 2015 3:02 PM
To: Theepan
Cc: Erlang Questions Mailing List
Subject: Re: [erlang-questions] Accessing a single value from MAPS


Hi Theepan,


On Sep 6, 2015, at 1:45 PM, Theepan <
<mailto:> > wrote:




What is the syntactic sugar to access single value from MAPS? I know there
is this "get" method, but will be good to have something like DOT notation,
like we do with records. Could not find it in the documents.



A = #{my_key => 1}.

#{my_key := Val} = A.



For information about maps you can read this [1]


Hope this helps,


[1] http://learnyousomeerlang.com/maps#about-this-chapter


It will be handy to access nested MAPS.




erlang-questions mailing list


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151007/2b49fd6a/attachment.html>

More information about the erlang-questions mailing list