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
···
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.