1 parenthesis:
print ( (1..10).collect do |x| x**2 end ) SyntaxError: compile error
More details:
(irb):1: syntax error, unexpected kDO_BLOCK, expecting ')' print ( (1..10).collect do |x| x**2 end ) ^ (irb):1: syntax error, unexpected kEND, expecting $end print ( (1..10).collect do |x| x**2 end ) ^
2 parentheses:
print (( (1..10).collect do |x| x**2 end )) 149162536496481100=> nil
I understand the difference between print (a) do <...>
and print(a) do <...>
. But what is the difference in my case? Why are two parentheses not the same as one?