lua-users home
lua-l archive

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


> Come to think of it, this already exists!
> Write "getinfo(1).func" inline or define
>
>  function currentfunc()
>   return getinfo(2).func
>  end
>
> Yeah, metamechanisms instead of language features!

This is all very well, but section 7.4 of the manual says "Please resist the
temptation to use [the debugging interface] as a usual programming tool".
(BTW, "a usual programming tool" is not comfortable English; how about
"...the temptation to use them for normal programming"?

So it's all very well if this function is permitted for normal use, but at
the moment it's not. This would seem to be a case in which having a function
"recurse()", which could be implemented as "getinfo(1).func", would be
useful, to hide the implementation details.

While I look at it, I can't see a "func" field mentioned anywhere in the
docs...does this have something to do with supplying "f" as "what"? In that
case, it would seem more sensible to call getinfo(1, "f")...

This is another area of the documentation that could do with tidying up a
little for 4.1.

-- 
http://sc3d.org/rrt/ | Si hoc legere scis nimium eruditionis habes.