lua-users home
lua-l archive

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


>From jeske@home.chat.net Mon May 18 03:15:20 1998

RI> It wouldn't be difficult to implement a built-in function "num_params",
RI> which returns the number of parameters a function expects. However, it would
RI> not work neither for C functions nor for vararg functions. So, it doesn't
RI> seem very useful as a generic facility.

>It does seem odd just to throw away this information at compile time
>though, given that it is there. Perhaps it would be worthwhile to preserve
>this information for functions which make it available. Namely, a lua

The information about the number of parameters a function expects is preserved
for run time, because it's needed for adjustment.

>grabbed by some fallback style function. So normally it would just get
>trashed, but if you wanted to do something strange, you could hook the
>"define function" fallback, and you would know all the arguments, and
>their names.

Like I said, I don't see any need for a "define function" fallback,
given the existence of the "setglobal" tag method.
--lhf