lua-users home
lua-l archive

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


On Sat, Jan 9, 2010 at 10:32 AM, Mark Hamburg <mark@grubmah.com> wrote:
function pushscope( env ) which, provided it knew the current
environment (that's part of the trick to writing it), could construct
a new environment tacking the argument onto the top of the stack.

Yes, otherwise it's awkward to access the enclosing environment, which
requires setting up some locals first.   Such a function would lean on
debug.getfenv, of course. But would it not have to build a new
environment into which the enclosing environment is injected? Is this
not rather expensive for a dynamical construct?

Incidently, the somewhat single-minded nature of in t do ... end makes
it less open to abuse/confusion than Pascal with.

steve d.