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


=begin
Thanks, I didn't know about this!

However, this use of a beginning dot does not excite me:  it does not just use the previous statement value as the receiver, it in fact continues the previous line, which can also be done be leaving the dot on the previous line.

This makes it not clear if a line is over, and is not usable in IRB.

It would make more sense to me if a call with "empty receiver" always used either the value returned by the previous line, or the previously returned expression value, as the receiver:

  'aa.bbb.cccc'.split('.')
  prefix, suffix = .first, .last # => ['aa', 'cccc']

or

  'aa.bbb.cccc'.split('.')
  prefix, prefix_length = .first, .length # => ['aa', 2]
  
Well, this is not the original proposal anymore, i didn't mean to ask to deprecate the existing behavior.  I am still interested in other opinions.
=end

----------------------------------------
Feature #7055: Allow `.foo=` as a synonym of `self.foo=`
https://bugs.ruby-lang.org/issues/7055#change-29683

Author: alexeymuranov (Alexey Muranov)
Status: Open
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/