> On Wed, Jul 07, 2004 at 11:50:16PM -0400, JOSEPH RYAN wrote:
>
> To answer the latter first, rand (with no arguments) returns a number
> greater than or equal to 0 and less than 1 which when used as an index
> into an array gets turned into a 0.
> 
> As to why the second pop would take forever, I'd imagine that in order
> to pop the last item from the array, all of the elements must 
> first be
> generated (i.e. we lose all laziness). And unless we have some 
> magic for
> generating them from either end, it'll start at the begining and
> continue until the end, then stop before it ever does the pop. :-)

Ah, right, I should known that, in both cases. (:  Thanks for answering my silly 
questions.

- Joe

Reply via email to