[erlang-bugs] Missing comma between maps results in merge

José Valim jose.valim@REDACTED
Mon Jul 7 12:32:24 CEST 2014


FWIW, I don't see the automatic maps merge behaviour being useful to
justify itself or even the possible confusion it may cause.



*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Lead Developer


On Tue, Jul 1, 2014 at 4:42 PM, Björn-Egil Dahlberg <egil@REDACTED> wrote:

>  On 2014-07-01 16:26, Knut Nesheim wrote:
>
> Hi,
>
>  I was recently bitten by a combination of my own mistakes and a
> unexpected syntax with maps. I'm not sure if this is a bug or intended
> behaviour.
>
>  1> #{foo => bar, foo => quux}.
> #{foo => quux}
>  2> #{foo => bar} #{foo => quux}.
>  #{foo => quux}
>
>  In the second case, two maps are merged due to missing a separating
> comma between them. I would expect it to fail with a syntax error.
>
>
> It is the same behaviour as for records:
>
> 3> rr(t).
> [rec]
> 4> [#rec{foo=bar} #rec{foo=baz}].
> [#rec{foo = baz}]
>
>
>  Is this intended behaviour?
>
>
> The similarity with records is intentional .. but I agree that this
> behaviour should be revisited. I'm not convinced of it usefulness.
>
> Thank you for your feedback!
>
>
>  Regards
> Knut
>
>
> _______________________________________________
> erlang-bugs mailing listerlang-bugs@REDACTED://erlang.org/mailman/listinfo/erlang-bugs
>
>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140707/845c9ee5/attachment.htm>


More information about the erlang-bugs mailing list