On Aug 30, 8:47 am, [EMAIL PROTECTED] (John M. Dlugosz) wrote:
> Have the sort function simply return a lazy list object.  When the [4]
> is called on that object, it knows to do as much work as needed, and can
> leave the rest as lazy.

That may be half the answer, but simply making the decision lazily is
insufficient, because the guarantee that only exactly one item is
needed is lost. An algorithm that singles out exactly one ordered
element may be in retrospect inefficient if the list is later accessed
for other indices.

Reply via email to