Project

General

Profile

Actions

Feature #12241

closed

super end

Added by nobu (Nobuyoshi Nakada) over 8 years ago. Updated over 8 years ago.

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

Description

This is a refinement of [Feature #5054].

It required to count the depth of count to end, and tiresome.

This proposal will introduce "super end", !end, which ends the block began at the same column with !.

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

https://github.com/ruby/ruby/compare/trunk...nobu:feature/!end


Related issues 3 (1 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
Has duplicate Ruby master - Feature #17786: Proposal: new "ends" keywordOpenActions

Updated by duerst (Martin Dürst) over 8 years ago

Nobuyoshi Nakada wrote:

This proposal will introduce "super end", !end, which ends the block began at the same column with !.

I think this should be end!, to look like a Ruby method name :-).

Updated by shevegen (Robert A. Heiler) over 8 years ago

You almost got me with this one!

Also see the "endddd" suggestion. :)

Edit: Or perhaps "FINAL_END"

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

Martin Dürst wrote:

I think this should be end!, to look like a Ruby method name :-).

Since it conflicts with the existing syntax, and ruby-mode.el considers it an ordinary method call, autoindent doesn't work.

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

Robert A. Heiler wrote:

Edit: Or perhaps "FINAL_END"

It isn't always "FINAL".

module MyModule
  class MyClass
    def my_method
      10.times do
        if rand < 0.5 
          p :small
    !end
    def another_method
      while foo do
        my_method
    !end
!end

Updated by usa (Usaku NAKAMURA) over 8 years ago

  • Assignee set to 10790

Updated by windwiny (wind winy) over 8 years ago

NOOOO GOOD!! is ruby want become to perl?

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Status changed from Open to Rejected
Actions #8

Updated by nobu (Nobuyoshi Nakada) about 7 years ago

Actions #9

Updated by shyouhei (Shyouhei Urabe) over 4 years ago

Actions #10

Updated by duerst (Martin Dürst) over 3 years ago

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0