2 ms·
They don't have the same precedence. foo bar { ... } # bar receives the block foo bar do ... end # foo receives the block The later, paired with the n
by hashmal 6y ago
They don't have the same precedence.
foo bar { ... } # bar receives the block
foo bar do ... end # foo receives the block
The later, paired with the non-mandatory parentheses for calls, allows to read and write some really neat stuff.
The former is most often used for one-liners indeed.