[#47409] [ruby-trunk - Feature #6973][Open] Add an #integral? method to Numeric to test for whole-number values — "regularfry (Alex Young)" <alex@...>

12 messages 2012/09/03

[#47481] [ruby-trunk - Bug #7008][Open] rake is crashing when trying to compile ffi gem — "drookie (Eugene M. Zheganin Eugene M. Zheganin)" <eugene@...>

10 messages 2012/09/12

[#47505] [ruby-trunk - Feature #7019][Open] allow `private` and `protected` keywords to take blocks — "alexeymuranov (Alexey Muranov)" <redmine@...>

15 messages 2012/09/13

[#47582] [ruby-trunk - Bug #7037][Open] float formatting inconsistently rounds half to even — "headius (Charles Nutter)" <headius@...>

14 messages 2012/09/19

[#47638] [ruby-trunk - Bug #7046][Open] ERB#run and ERB#result are not safe for concurrent use — "headius (Charles Nutter)" <headius@...>

11 messages 2012/09/21

[#47655] [ruby-trunk - Feature #7051][Open] Extend caller_locations API to include klass and bindings. Allow caller_locations as a method hanging off Thread. — "sam.saffron (Sam Saffron)" <sam.saffron@...>

13 messages 2012/09/23

[#47657] [ruby-trunk - Feature #7055][Open] Allow `.foo=` as a synonym of `self.foo=` — "alexeymuranov (Alexey Muranov)" <redmine@...>

11 messages 2012/09/23

[#47730] [ruby-trunk - Bug #7085][Open] Subversion → GitHub gateway stops. — "shyouhei (Shyouhei Urabe)" <shyouhei@...>

27 messages 2012/09/29

[#47735] [ruby-trunk - Bug #7087][Open] ::ConditionVariable#wait does not work with Monitor because Monitor#sleep does not exist — "rklemme (Robert Klemme)" <shortcutter@...>

10 messages 2012/09/29

[#47759] [ruby-trunk - Bug #7092][Open] StringScanner start-of-line matches false positives, while lookbehind for a newline gives false negatives — "jayferd (Jay Adkisson)" <jjmadkisson@...>

8 messages 2012/09/30

[ruby-core:47659] [ruby-trunk - Feature #7055] Allow `.foo=` as a synonym of `self.foo=`

From: "alexeymuranov (Alexey Muranov)" <redmine@...>
Date: 2012-09-23 12:42:29 UTC
List: ruby-core #47659
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/

In This Thread