in reply to Re: Re: (OT) Interview questions -- your response?
in thread (OT) Interview questions -- your response?
Well, technically, doesn't 0..$#array create an (anonymous) array, which reverse then reverses? :)Technically no. The 0..$#array just creates a list from zero to the last index, reverse 0..$#array is the list of indices reversed. So we are not reversing the array, just creating a slice with with reversed indices and assigning that slice to the a slice with all the indices in order. I imagine a built-in array reversal would be more like Ruby's array.reverse! method.
|
---|
Replies are listed 'Best First'. | |
---|---|
(bbfu) (array vs. list reversal) Re4: (OT) Interview questions -- your response?
by bbfu (Curate) on Sep 05, 2002 at 05:13 UTC | |
Re^4: (OT) Interview questions -- your response?
by Aristotle (Chancellor) on Sep 05, 2002 at 04:06 UTC |