Project

General

Profile

Actions

Feature #5065

closed

Allow "}" as an alternative to "end"

Added by lazaridis.com (Lazaridis Ilias) over 13 years ago. Updated over 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:38303]

Description

I've noticed issue #5054, subjecting an "endall".

module MyModule
  class MyClass
    def my_method
      10.times do
        if rand < 0.5
          p :small
        endall

To reduce typing, but to keep the levels, the following construct could be allowed:

module MyModule
  class MyClass
    def my_method
      10.times {   # "10.times do" would work, too
        if rand < 0.5
          p :small
        }
      }
    }
  }
}

The speciality of this language would be, that an opening brace is not necessary

Several constructs allow already the use of "{}" (do / end), thus this would be possibly the consistent way to reduce typing effort, but to keep the structure intact.


Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #5054: Compress a sequence of endsRejectedtechnohippy (Yasushi ANDO)Actions
Related to Ruby master - Feature #16746: Endless method definitionClosednobu (Nobuyoshi Nakada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0