[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Function argument count
- From: Taj Khattra <taj.khattra@...>
- Date: Mon, 27 Oct 2003 15:30:50 -0800
On Mon, Oct 27, 2003 at 04:28:45PM -0500, RLake@oxfam.org.pe wrote:
> > Is there any way to determine how many arguments an arbitrary function
> > expects?
hmmm, couldn't one say that the Lua function 'function(x) end'
expects one argument and 'function(x, y, ...) end' expects at least
two arguments, irrespective of how many they actually receive ?
the debug interface currently doesn't expose the "numparams" and
"is_vararg" elements of LClosure. it would be easy to add them
(maybe as part of lua_getinfo() 'S' option ??) if someone really
> f=function(x, y, ...) end