lua-users home
lua-l archive

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


> 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
> say...

> This is a (nice) example of the freedom we have when we do not overspecify
> things in the manual.

However, in general I think best practice is to make C API functions behave
just like Lua ones when passed more or fewer arguments. Unfortunately there
are a few standard functions that break this (they can tell the difference
between being passed a nil final argument and no final argument), but it's a
good thing to work towards; then no-one is surprised.

-- 
http://sc3d.org/rrt/ | free, a.  already paid for (Peyton Jones)