Project

General

Profile

ActionsLike0

Feature #6354

open

Remove escape (break/return/redo/next support) from class/module scope

Added by ko1 (Koichi Sasada) almost 13 years ago. Updated over 7 years ago.

Status:
Assigned
Target version:
-
[ruby-core:44612]

Description

Let's remove global escape (break/return/redo/next support) from class/module scope.

Yes, it introduces incompatibility. However, anyone use it?
I think the following examples are evil (difficult to understand).

examples:

1.times{
class C
break # break from 1.times
end
}

1.times{
class C
module M
break # break from 1.times
end
end
}

3.times{|n|
p n # repeat print 0
class C
redo
end
}

->{
class C
return return from outer lambda block
end
}.call

->{
proc{
class C
return # return from outer lambda (not proc) block
end
}.call
}.call

etc, etc.

Updated by mame (Yusuke Endoh) almost 13 years ago

  • Status changed from Open to Assigned

Updated by ko1 (Koichi Sasada) over 12 years ago

  • Target version set to 2.6
#8

Updated by naruse (Yui NARUSE) over 7 years ago

  • Target version deleted (2.6)
ActionsLike0

Also available in: Atom PDF