[erlang-questions] Accessing a single value from MAPS

Ivan Carmenates Garcia co7eb@REDACTED
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
this

 

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

 

Cheers,

Ivan (son of Gilberio).

 

 

 

From: erlang-questions-bounces@REDACTED
[mailto:erlang-questions-bounces@REDACTED] On Behalf Of Milton Inostroza
Aguilera
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 <vasdeveloper@REDACTED
<mailto:vasdeveloper@REDACTED> > 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





 

It will be handy to access nested MAPS.

 

Thanks,

Theepan 

_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED <mailto:erlang-questions@REDACTED> 
http://erlang.org/mailman/listinfo/erlang-questions

 

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


More information about the erlang-questions mailing list