From: "Hal E. Fulton" Date: 2003-08-10T03:18:20+09:00 Subject: Re: Ruby and OOP-design (question of an old "procedural person" ;) ----- Original Message ----- From: "Martin DeMello" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Saturday, August 09, 2003 7:52 AM Subject: Re: Ruby and OOP-design (question of an old "procedural person" ;) > Well and good, but they don't document the fact that the return value > can be used as anything other than a boolean. Duck typing or no, I find > it conceptually messy to have a method called nonzero? return self > rather than true - compare nil? and zero?. Using the value of self feels > like relying on an undocumented side effect. But as long as it isn't false or nil, it *is* true in effect. And it's far from undocumented. Yet in a way I sympathize... where I *would* feel funny is if I made use of the numeric value returned rather than just checking its truth... but I could probably get over even that. > (I feel the same way about > ! methods returning nil rather than self when they haven't made a > change). There we're in full agreement. I see the rationale for this, but I *never* use the test for nil here (nor have I ever felt the need to). All this does for me is prevent method chaining in certain (fairly obscure) circumstances. Hal -- Hal Fulton hal9000@hypermetrics.com