Difference between grouping parentheses and `begin` ... `end`

100 views Asked by At

What is the difference between parentheses used for grouping:

(some_method_chain; another_method_chain)

2 * (3 + 4) # => 14

and the begin ... end structure:

begin some_method_chain; another_method_chain end

2 * begin 3 + 4 end # => 14

I notice that only the latter can be used to enclose a rescue construction. Are there any other differences?

0

There are 0 answers