On Sat, Aug 30, 2008 at 4:22 AM, Dave Whipp <[EMAIL PROTECTED]> wrote:

> Lets say I want to find the 5th smallest element in an array. I might
> write:
>
>  @array.sort.[4];
>
> How does the implementation of the sort function know that I just want to
> 5th item (and thus choose an appropriate optimization)? Obviously the
> function could be told that it's caller wants 5 values in list context, but
> is there a way to get more info than that?
>


The second dot is superfluous since [] isn't a method. You should say:
@array.sort[4];

Reply via email to