lua-users home
lua-l archive

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


>> Regardless of motivation, there's a technical limitation of current
>> function environments that lexical environments are solving, and it
>> can only be solved by introducing new syntax (it's gotta be a lexical
>> thing). Currently you can't have the same function in two environments
>> at the same time.
>
> Well you can. I guess you mean a function can't have 2 environments at
> the same time. My understanding is that it still can't.

Right, sorry I spoke too early. So what this actually does is sparing
you a closure and the associated ugly syntax. Then maybe pcall()
should deserve the same improvement for less garbage-making error
handling?

Problem is, I don't see how orbit.htmlize() can still be implemented in 5.2 :(

How about a built-in function ecall(env,f,...) ? And of course,
ecall() would NOT be implemented via setfenv(), so you could still
call f() properly from another thread while inside ecall().