[erlang-questions] Accessing a single value from MAPS

Milton Inostroza Aguilera <>
Sun Sep 6 21:02:00 CEST 2015


Hi Theepan,

> On Sep 6, 2015, at 1:45 PM, Theepan <> wrote:
> 
> Team,
> 
> 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.
Val.

For information about maps you can read this [1]

Hope this helps,

[1] http://learnyousomeerlang.com/maps#about-this-chapter <http://learnyousomeerlang.com/maps#about-this-chapter>
> 
> It will be handy to access nested MAPS.
> 
> Thanks,
> Theepan 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150906/5185df8e/attachment.html>


More information about the erlang-questions mailing list