From: Eero Saynatkari Date: 2006-02-20T09:24:33+09:00 Subject: Re: Unexpected syntax error Daniel Harple wrote: > $ ruby -v > ruby 1.8.4 (2005-12-24) [powerpc-darwin8.3.0] > > # Example to illustrate the problem > def foo1 > p (1..10).method(:each) > end > > def foo2() > p((1..10).method(:each)) > end > > def foo3() > p (1..10).method(:each) > end > > foo1 # -> No error > foo2 # -> No error > foo3 # -> Error > > __END__ This is quite bizarre. The parentheses on foo3 cause the problem; leaving them out, adding a semicolon after them or creating a temporary variable instead of the direct p will all solve the error. I would, though, venture that this should not be an error :) > -- Daniel E -- Posted via http://www.ruby-forum.com/.