Issue #13927 has been updated by shevegen (Robert A. Heiler).


I wanted to write a reply but it was too long, so here just a shorter one.

Even new syntax may make a language more complex but also simpler at the same
time. People have to learn/understand what a concept means in a language. New
features may provide more flexibility but often makes a language also more 
complex. A good example is refinements - it's not so difficult but there is
some syntax (how to activate a refinement) and people may have to understand
how refinements work.

Anyway, not going to write too much, but when I was writing my longer reply,
I actually wondered whether this change targets ruby 2.x or ruby 3.x.

Rocifier, can you say which ruby you have had in mind primarily?

If ruby 3.x, I guess it may be possible to also release "future" ruby 
builds that are pre-ruby 3.x, with more experimental changes so that people
can test them extensively well before ruby 3.x will be finalized. Not just
in regards to the module_function situation (I am neutral on this) but
in general.

If ruby 2.x then this is much harder. Not everyone wants to be required to
have to adjust syntax code all of a sudden and not everyone knows how to
use rubocop either or wants to be required to have to use it.

----------------------------------------
Feature #13927: Integrate module_function as a core language type
https://bugs.ruby-lang.org/issues/13927#change-66848

* Author: rocifier (Ryan O'Connor)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Using ruby commercially we have discovered that modules are no longer serving their original intended purpose of mixins. Another usage of the module has been shoehorned by using module_function. We have found that when developers use module_function they are converting the module into a new concept, and no longer intend their module to be used as a mixin for classes. Instead the intent of this new type of module is to provide publically accessible class methods withoutthe need for instantiation, and without polluting the global namespace. This usage is becoming potentially more common than the mixin usage.

I propose that we integrate the module_function pattern as its own core ruby object along with Module and Class.



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

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