[erlang-questions] [erlang-question][maps][comprehension]

Richard A. O'Keefe ok@REDACTED
Thu Jun 23 02:59:26 CEST 2016



On 23/06/16 7:22 AM, Sachin Panemangalore wrote:
> Hi
> A question on comprehension in erlang in general.
>
> [{X,Y} || X<-[1,2,3], Y<-[a,b,c]].   works
>
> but
>
> #{X=>Y || X<-[1,2,3], Y<-[a,b,c] }  does not
>
> any specific reason why this was not implemented ( since Erlang is 
> relative mature my guess is its a design choice by the creators of 
> Erlang ).
>
What is it supposed to mean?  Expanding the generators out,
#{ 1 => a, 1 => b, 1 => c, 2 => a, 2 => b, 2 => c, 3 => a, 3 => b, 3 => c }
is not really a meaningful map.



More information about the erlang-questions mailing list