Project

General

Profile

Actions

Bug #1017

closed

Curly braces {...} and do ... end

Added by einarmagnus (Einar Boson) over 16 years ago. Updated about 14 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-core:21373]

Description

=begin
I gather that curly braces and do..end are supposed to work the same, why then is this ok

def save_block name, &b
  @blocks ||= {}
  @blocks[name] = b
end

save_block :say_hello do
  puts "hello!"
end

but not this:

save_block :say_hello {
  puts "hello!"
}

#ruby 1.9.1p5000 (2009-01-13 trunk 21497) [i386-darwin9.6.0]
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0