
Issue #21209 has been updated by mame (Yusuke Endoh). A similar issue was raised in #21155. We discussed that issue at the last dev meeting, and several endless class definition syntax was proposed. ```ruby module = Foo in module Foo for module Foo ``` However, @matz didn't like any of them. Also, he said that this issue was inevitable in object-oriented programming, and that he would close #21155 (which doesn't seem to be closed yet). So perhaps this proposal is also hopeless. (Personally, I would like to solve this problem, though.) ---------------------------------------- Feature #21209: Endless classes and modules https://bugs.ruby-lang.org/issues/21209#change-112547 * Author: Dan0042 (Daniel DeLorme) * Status: Open ---------------------------------------- Endless methods have proven popular enough that we should bring the same endlessness to module/class definitions. For a long time we've had this ugly pattern of class definitions with an extreme level of indentation. I propose a simple new rule to fix this: if a 'class' or 'module' statement is at the beginning of a line, the matching 'end' becomes optional; EOF is enough. instead of: ```ruby module Arel module Visitors class UnsupportedVisitError module ClassMethod module AmIDeepEnough module NoNotDeepEnough class LetsGoDeepter def firstmethod "man, I'm just the first method and already indented 14 spaces deep!" end end #what end #a end #chain end #we end #have end #here end #weee!!! ``` we can have the much more readable: ```ruby module Arel module Visitors class UnsupportedVisitError module ClassMethod module AmIDeepEnough module NoNotDeepEnough class LetsGoDeepter def firstmethod "now that's better!" end ``` Brilliant! -- https://bugs.ruby-lang.org/