Project

General

Profile

Actions

Feature #7299

closed

Ruby should not completely ignore blocks.

Added by marcandre (Marc-Andre Lafortune) over 11 years ago. Updated over 11 years ago.

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

Description

Ruby should not completely ignore blocks.

const_set :Example, Class.new do
p "Hello, world"
end

Doesn't print anything, generate any warning nor error.

To minimize any impact, Ruby should issue a warning, and in future version could even raise an error.

Even unused variables provide warnings in verbose mode, and they have their use.

I can't think of a case where passing a block to a builtin method that doesn't accept a block is not a programming error though.

If this is approved, I volunteer to implement this.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0