Issue #6225 has been updated by duerst (Martin Dürst).


In common sense, * is also commutative. But of course, for matrix multiplication, it's not.

Also, + is used in many fields of mathematics. I'm not a mathematician, but I very strongly doubt that it's commutative in all these cases. (see e.g. http://arxiv.org/abs/1003.2081 for an example)

What's much more important is whether the + for Hash fits the general image a Ruby programmer has for +. I'm not exactly sure about this, but the parallel with Array is not too bad.
----------------------------------------
Feature #6225: Hash#+
https://bugs.ruby-lang.org/issues/6225#change-25448

Author: trans (Thomas Sawyer)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: 2.0.0


Strings and Arrays can be combined with #+. I don't see any reason not to allow Hashes to do so as well.

  class Hash
    alias :+ :merge
  end



-- 
http://bugs.ruby-lang.org/