From: Steve Litt Date: 2005-12-09T10:11:29+09:00 Subject: Re: do/end vs braces On Thursday 08 December 2005 06:06 pm, Jacob Fugal wrote: > On 12/8/05, Steve Litt wrote: > > Except I can't put in the parentheses: > > > > #!/usr/bin/ruby > > my_array = ["alpha", "beta", "gamma"] > > puts (my_array.collect do > > > > |word| > > > > word.capitalize > > end) > > > > Output: > > [slitt@mydesk slitt]$ ./test.rb > > ./test.rb:3: syntax error > > ./test.rb:6: syntax error > > Take out the space between puts and the open paren: Confirmed! Thanks Jacob. This is the first time I've seen Ruby conflict with the Rule of Least Surprise (http://www.faqs.org/docs/artu/ch11s01.html). Is there any chance of a Ruby change so as not to require the paren to be flush up against the function name? Thanks SteveT Steve Litt http://www.troubleshooters.com slitt@troubleshooters.com