From: "S.Z." Date: 2006-09-20T22:35:12+09:00 Subject: Re: the point of omitting parentheses Timothy Goddard писал(а): > > 2) such methods as DRb::start_service or join need empty parentheses -- > > like start_service() or join(); > > No, they don't. The motivation follows: join without parentheses is a function call like self.join, returning String for Array. I should add () to emphasize that the join is an action -- not a value. If I wrote join without () this means self.join with self omited. > > 3) methods with one String argument like puts "Hello!" or p > > self.inspect need no parentheses; > > Correct again. > > > 4) p with two or more arguments or with one argument of type different > > from String need parentheses. > > Did you bother to check this? Yes I did. In addition, I do write print "#{a.inspect}" insted of print a.inspect I think of the reader. Is it axtra-thinking? -- may be. > I prefer the lack of parentheses for the first function on a line. I > always parenthesise functions passed as an argument to another even > where only a single argument is taken though. It is a rule. Thanks. Respects, S.Z.