From: Vladimir Van Bauenhoffer Date: 2011-09-13T14:57:35+09:00 Subject: Re: Any downsides to writing paranthesises? Chad Perrin wrote in post #1021546: > To my knowledge, there is no technical difference for executing code > between when it has parentheses and when it lacks them, as long as you > don't run into precedence problems. What does precedence problems mean exactly? >For instance, these two lines of > code have the same effects when executed: > > Dir.glob("*txt") > Dir.glob "*txt" > > These two, however, do not: > > Dir.glob("txt").map {|x| x.sub(/foo/, 'bar') } > Dir.glob "txt".map {|x| x.sub(/foo/, 'bar') } Does that mean you have to use paranthesises if you want to use the code above? > You seem unaware that to_a and length, in the above example provided by > hex, *are* methods. Yeah Im facepalming right now, of course they are methods. Silly me. -- Posted via http://www.ruby-forum.com/.