From: James Edward Gray II Date: 2005-07-21T11:54:26+09:00 Subject: Re: What does this construct mean? On Jul 20, 2005, at 7:20 PM, Casper wrote: > To be honest, that the following two lines > puts (3+4).abs > puts(3+4).abs > are semantically different *feels* very broken to me. My gut says that > this is a vector for confusion and the introduction of bugs. > > That being said, I'm not ready to defend the statement that it *is* > broken. I'll try to live with it for a while and see if I come around. > :-) In Ruby, parenthesis are sometimes optional, just as a convenience to you the coder. In any midly complex case, just go ahead and include them and you never need to worry about this again. I leave parenthesis off: 1. No parameter attributes: object.attr 2. Boolean method tests: if object.is_a? Whatever 3. Simple IO: puts "Printing this out #{(3 + 4).abs}..." The rest of the time, just add them. If you have to stop and think for even a second, it's time to add some parenthesis. Then you never need worry again. James Edward Gray II