Re: Missing comma between maps results in merge
José Valim <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.bugs |
|---|---|
| Message-ID | <CAGnRm4+BP3qAvx6gw-UipVQ-m2d5yB97T=y+=t8Tu63AYroApg@mail.gmail.com> |
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 <[email protected]> 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 [email protected]://erlang.org/mailman/listinfo/erlang-bugs > > > > _______________________________________________ > erlang-bugs mailing list > [email protected] > http://erlang.org/mailman/listinfo/erlang-bugs > > _______________________________________________ erlang-bugs mailing list [email protected] http://erlang.org/mailman/listinfo/erlang-bugs