lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I've recently tried to implement an algorithm that requires sorting just
a section of an array at a time.

Unless I'm missing something this requires making copies of the
sub-array in Lua which is sub-optimal.

Would it be possible to change (using the syntax from the reference
manual):

table.sort(list [, comp])

  to

table.sort(list, [, comp [, i [, j]]])

Where i and j are the first and last indexes to sort between and they
default to 1 and #list respectively.


Daniel Slaney