[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>

Hello,

9 messages 2017/10/04

[ruby-core:83610] [Ruby trunk Feature#10183] An alternative name for method `class`

From: tom@...
Date: 2017-10-30 03:56:46 UTC
List: ruby-core #83610
Issue #10183 has been updated by wardrop (Tom Wardrop).


Came here to make a similar feature suggestion. Ideally `class` would be aliased as something such as `klass` which has become somewhat of a ruby idiom to avoid collision with the `class` keyword. Though I'd also be interested to discuss the possibility of introducing shorter syntax for `self.`, such as some kind of single-character prefix. Some examples:

```ruby
self.class::MYCONST

klass::MYCONST # alias of #class method

$class::MYCONST # special global

~class::MYCONST # tilda prefix shouldn't clash with any existing syntax rules
```

----------------------------------------
Feature #10183: An alternative name for method `class`
https://bugs.ruby-lang.org/issues/10183#change-67632

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
The method `class` is special in that it always has to have an explicit receiver in order to avoid crash with the keyword `class`. But this is very inconvenient. I have seen so many

    self.class

in codes. I propose that there should be an alternative name for this method so that it can be used with an implicit receiver, and the method name `class` should be gradually depricated.

As for the name, I have no clear idea. I can only think of `klass`, but perhaps someone else might come up with a better name.



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

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next