[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: A strange problem with table.sort()
- From: Ketmar Dark <ketmar@...>
- Date: Thu, 26 Jul 2007 15:52:30 +0300
On Thu, 26 Jul 2007 14:30:17 +0200
Alen Ladavac <email@example.com> wrote:
> Because "anybody" may expect that the manual is written so that the
> facts are layed out plainly, not so that people have to "try to
> understand it". Gotchas should be _stated plainly_ - that's an
> important rule when writing technical docs.
i can't see any problems or "gotchas" in table.sort() implementation.
the docs is clear and meaningful. if somebody just read the sentence
about "compare function" and skipped the others -- it's a reader's
problem, not writer's one. i think that Lua manual is close to
perfection: it is small, easily understandable and complete.
this sentention gives anoght infomation to fully understand everything,
"so that `not comp(a[i+1],a[i])' will be true after the sort"
nothing cryptic here.
maybe the manual should mention that the behavior of table.sort() is
undefined in any other case. but isn't it safe to assume that execution
results is undefined in any cases the manual omits?