Closed Burgestrand closed 9 years ago
4b46db5 adds bang-alternatives to attribute, collection and map. @jnicklas what do you think?
This pull request should have an accompanying update to the README.
I think this makes sense. As we discussed, there are cases where it does make sense to override the same key, but I think it's very rare.
If we compare this to Ruby, the precedent is to print a warning on key collision:
[1] pry(main)> { foo: 123, foo: 321 }
(pry):1: warning: duplicated key at line 1 ignored: :foo
=> {:foo=>321}
But I don't really think that makes sense in this case.
We could have one method for disallowing it, and one method for allowing it.