On Wed, Jul 14, 2004 at 07:40:33AM +0200, Ph. Marek wrote: > > To repeat Dave and myself - if > @x = 1 .. Inf; > then > rand(@x) > should be Inf, and so > print $x[rand(@x)]; > should give Inf, as the infinite element of @x is Inf.
Does it even make sense to take the Infiniteth element of an array?...after all, array indices are integers, and Inf is not an integer. If we allow it, should we also allow people to take the NaNth element of an array? How about the 'foobar'th element? What happens if I take the Infiniteth element of a finite list? I think I would prefer if using Inf as an array index resulted in a trappable error. --Dks