From: Ryan Allan Date: 2007-07-02T07:13:12+09:00 Subject: Re: Variable argument number and behaviour Thank you Stefano. You're right; the empty? method is nicely obvious. I do have a further question, however. You've highlighted a problem with my original idea, but I don't understand it. > Besides, even if it > had been possible, your approach would have had a problem: you wouldn't have > been able to distinguish the case of a single nil argument from the case of > no arguments: > > function(nil) > > function() > > The correct approach solves this problem: if no arguments are passed, > sometimes is empty (empty? returns true); otherwise it's not empty, even > if all arguments are nil. What is the difference between no arguments and a single nil argument? It seems to me that the cases are logically equivalent. Ruby treats them separately? Thanks again, -Ryan -- Posted via http://www.ruby-forum.com/.