[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Recursive local functions
- From: Daniel Silverstone <dsilvers@...>
- Date: Thu, 4 Jan 2001 17:42:33 +0000
On Thu, Jan 04, 2001 at 05:09:21PM +0000, Reuben Thomas wrote:
> 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.
Indeed - however, it is /impossible/ (AFAICT) to implement such a
function, even in 'C' without taking in the ldblib library or #include'ing
"luadebug.h" which is /NOT/ what I want to have to do.
It seems to me, that there is room, within the language specification, for
a set (or perhaps /one/) implicit variable in the 'var' section, or
perhaps in the 'varorfunc' bit, allowing for 'self' or 'this' or 'cfunc'
Whilst I agree wholeheartedly with keeping the language as small as
possible, I do feel that there is a good argument for not pushing language
features into meta syntax, when said metasyntax relies on /DEBUGGING/
I will look at the bits of the lua source pertaining to lua_getstack() and
decide whether a minor reimplementation to cope with getting the function
directly 'up' is sensible, or whether it ought to be a language thing
I'm still reasonably sure that this would be a /minor/ language addition
/well worth it/ in the long run.