Re: Seriali[sz]ation of functions...
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Seriali[sz]ation of functions...
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2008年2月17日 08:43:05 -0300
> Is there any way to determine that a function is suitable for
> seriali[sz]ation with string.dump() other than by using debug.getupvalue()
> to check if it has upvalues?
You can use debug.getinfo(f,"u").nups.
Or you can string.dump it and read that value from there:
s=string.dump(f)
ni=string.byte(s,9)
n=string.byte(s,13)
n=string.byte(s,16+n+2*ni+1)
print(n)
--lhf