[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [Discuss] ruby, enum all? bug

Craig Demyanovich

6/11/2008 9:32:00 PM

On Wed, Jun 11, 2008 at 4:01 PM, Daniel Parker <dcparker@gmail.com> wrote:
> I agree, even though the docs do explain exactly what it does, it seems like
> it shouldn't return true. Maybe returning nil would be more appropriate when
> there are no elements.

That the code does what the docs indicate is beside the point (though
it's good that they're in agreement ;-) ). The behavior is definitely
not what I would've expected, which is to return false. My vote is to
just return false when there are no elements. I like to avoid nil
whenever possible (which is almost always) because it forces client
code to use a conditional to check for it.

Regards,
Craig