Project

General

Profile

Actions

Feature #14396

closed

public, protected and private should return their arguments instead of self

Added by usa (Usaku NAKAMURA) almost 7 years ago. Updated almost 7 years ago.

Status:
Rejected
Target version:
[ruby-dev:50428]

Description

Matsuda-san suggested me that public, protected and private should return their arguments instead of self,
to write such code:

require "finalist"
# see https://github.com/joker1007/finalist

class Foo
  extend Finalist

  final private def foo
  end
end

I believe that it's reasonable request, and also believe that there is no product code which uses the return value of public, protected and private.
Matz, how about this change?
The patch is attached.


Files

return_values_of_visibility_methods.diff (7.47 KB) return_values_of_visibility_methods.diff usa (Usaku NAKAMURA), 01/24/2018 09:13 PM

Related issues 1 (1 open0 closed)

Is duplicate of Ruby master - Feature #14397: public, protected and private should return their arguments instead of selfAssignedmatz (Yukihiro Matsumoto)Actions

Updated by usa (Usaku NAKAMURA) almost 7 years ago

  • Status changed from Assigned to Rejected

誤ってruby-devに投げてしまったのでこっちは閉じます。
[Feature #14397] を参照。

Actions #2

Updated by usa (Usaku NAKAMURA) almost 7 years ago

  • Is duplicate of Feature #14397: public, protected and private should return their arguments instead of self added
Actions

Also available in: Atom PDF

Like0
Like0Like0