标签: ruby parentheses control-structure
用于分组的括号之间有何区别:
(some_method_chain; another_method_chain) 2 * (3 + 4) # => 14
和begin ... end结构:
begin
end
begin some_method_chain; another_method_chain end 2 * begin 3 + 4 end # => 14
我注意到只有后者可以用来封装rescue构造。还有其他区别吗?
rescue