Project

General

Profile

Actions

Feature #4840

closed

Allow returning from require

Added by rosenfeld (Rodrigo Rosenfeld Rosas) about 10 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:36785]

Description

I have a situation where there is some code in Gitorious like:

unless defined? GitoriousConfig
  # tons of lines here
end

And I would it to look like

return if defined? GitoriousConfig

#tons of lines here

It would be great to allow return from a required file or some other keyword (break, etc or a new one)


Files

feature-4840.odp (114 KB) feature-4840.odp Slide for presentation to Matz rosenfeld (Rodrigo Rosenfeld Rosas), 06/08/2012 02:38 AM
0001-compile.c-toplevel-return.patch (1.71 KB) 0001-compile.c-toplevel-return.patch nobu (Nobuyoshi Nakada), 05/09/2013 11:14 AM

Related issues

Related to Ruby master - Bug #13678: toplevel return causes [BUG]ClosedActions
Related to Ruby master - Bug #13682: return inside of ensure causes [BUG]ClosedActions
Related to Ruby master - Bug #13755: Null pointer dereference in hash_table_index()ClosedActions
Related to Ruby master - Bug #14062: Top-level return allows an argumentClosedActions
Actions

Also available in: Atom PDF