Issue #7055 has been updated by alexeymuranov (Alexey Muranov).


@stomar, maybe you are right that `self.foo =` is more readable than `@.foo =` or `.foo =`, especially for someone who would see it for the first time.  However, then it seems to me that `bar = self.foo()` is also more readable than just `bar = foo`. Maybe i do not understand what exactly is meant by "readability" here.

I agree that 4 characters is not a lot to be replaced with 1, but if all 4 were removed, as in the original proposal, i would have liked it.
----------------------------------------
Feature #7055: Allow `.foo=` as a synonym of `self.foo=`
https://bugs.ruby-lang.org/issues/7055#change-29804

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 


=begin
I propose to make the use of `self` in method calls optional:

  .foo = 'bar'

instead of

  self.foo = 'bar'

This only matters of course for assignment methods, to distinguish a method call from creating or setting a local variable.
=end



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