Hi Alberto,
We’ve extended the variable argument support in closures. If it’s possible can you fold it into squirrel.
SQRESULT sq_getclosureinfo(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger *nparams,SQUnsignedInteger *nfreevars)
{
SQObject o = stack_get(v, idx);
if(sq_isclosure(o)) {
SQClosure *c = _closure(o);
SQFunctionProto *proto = _funcproto(c->_function);
*nparams = (SQUnsignedInteger)proto->_nparameters;
*nfreevars = (SQUnsignedInteger)c->_outervalues.size();
return SQ_OK;
} else if(sq_isnativeclosure(o)) {
SQNativeClosure *c = _nativeclosure(o);
*nparams = c->_nparamscheck;
*nfreevars = 0;
return SQ_OK;
}
return sq_throwerror(v,_SC("the object is not a closure"));
}
SQBool sq_getvarargs(HSQUIRRELVM v,SQInteger idx)
{
SQObject o = stack_get(v, idx);
if(sq_isclosure(o)) {
SQClosure *c = _closure(o);
SQFunctionProto *proto = _funcproto(c->_function);
return proto->_varparams;
}
return sq_throwerror(v,_SC("the object is not a closure"));
}
Chris.