[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Oddity with tinsert (Lua 4.0)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 13 Aug 2001 14:23:08 -0300
> Perhaps the user guide should state, "All functions will ignore any
> arguments after the number listed that they take." This is a reasonable
> assumption, but not one which is valid unless it is guaranteed.
Usually, when the manual says nothing, it follows that the behavior is
not defined. The manual does not need to be complete: That gives more
freedom for alternative implementations and for future versions.
About "tinsert", its implementation is correct according to its basic
description in the manual. It simply does not say what happens when you
call it with 4 arguments, so it can do anything. Unfortunately, the manual
also gave a Lua code "specification" which says much more than it needed to
> (Although inserting
> all of them would be cooler, and would not break any code which doesn't
> assume that tinsert can handle cases of other than exactly three
This is a (nice) example of the freedom we have when we do not overspecify
things in the manual.