From: Nobuyoshi Nakada Date: 2011-01-16T13:37:48+09:00 Subject: [ruby-core:34518] Re: [Ruby 1.9-Bug#4282] Range#map inconsistency with blocks like {...} and do...end (11/01/16 0:27), Andrei Kulakov wrote: > I got that, but one thing: how exactly should I explicitly put parentheses around my expression? > > Doing so: > > p ((1..2).map do |i| > i > end) > > yields syntax errors: > > issue.rb:1: syntax error, unexpected keyword_do_block, expecting ')' > p ((1..2).map do |i| > ^ > issue.rb:3: syntax error, unexpected keyword_end, expecting $end Don't put a space between the method name and the argument. When a space is placed, parentheses are considered as argument grouping, and arguments can't have DO block. -- Nobu Nakada