From: "matz (Yukihiro Matsumoto)" Date: 2012-10-31T02:23:59+09:00 Subject: [ruby-core:48621] [ruby-trunk - Feature #6373][Feedback] public #self Issue #6373 has been updated by matz (Yukihiro Matsumoto). Status changed from Assigned to Feedback Target version changed from 2.0.0 to next minor The point is when we see the code like: [1,2,3,4,5,1,2,2,3].group_by(&:self) sometimes it would be less intuitive that self refers elements in the array, not self in the scope. I think this cause YAM syndrome here. We haven't met name consensus yet (as usual), so I postpone to next minor. Matz. ---------------------------------------- Feature #6373: public #self https://bugs.ruby-lang.org/issues/6373#change-32035 Author: trans (Thomas Sawyer) Status: Feedback Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: core Target version: next minor =begin This was recently suggested to me as an extension: class Object # An identity method that provides access to an object's 'self'. # # Example: # [1,2,3,4,5,1,2,2,3].group_by(&:identity) # #=> {1=>[1, 1], 2=>[2, 2, 2], 3=>[3, 3], 4=>[4], 5=>[5]} # def identity self end end First, is such a method commonly useful enough to warrant existence? Second, it makes me wonder if #self should be a public method in general. =end -- http://bugs.ruby-lang.org/