Bart Lateur wrote:
>...
> In the same gist, a "last" inside the code block would, if you don't
> know exectution order, result in a completely unpredictable result.
>...
> p.s. Who cares that grep() processes every item for a boolean test? If
> you have a 1000 items, on average, you need 500 tests anyway if you're
> sure it is in there, and 1000 if it's not. Breaking out of grep early
> would at worst do nothing, and at best, on average, double the speed.

Yes.  But this argument goes out the window when the list being iterated
over is lazily evaluated.

-- 
John Porter

        We're building the house of the future together.

Reply via email to