lua-users home
lua-l archive

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


On Thu, Nov 10, 2011 at 4:10 PM, Stefan Reich
<stefan.reich.maker.of.eye@googlemail.com> wrote:
> The nuisance can be removed extremely easily - just keep setfenv.
> (Almost?) full compatibility. No downsides.

Although environments are the biggest change, they are not the only
source of incompatibility:
Any 5.1 script which tries to load bytecode will not be compatible
with 5.2, as the bytecode instructions changed.
Any 5.1 script which uses a local variable called _ENV (unlikely I
admit) will in all likelihood not be compatible with 5.2.
Any 5.1 script which assumes that function closures will always be
distinct will not be compatible with 5.2.
Any 5.1 script which depended on exact wording of error messages will
not be compatible with 5.2.
etc.

It is also impossible to write setfenv in 5.2 in such a way as to work
with bytecode chunks whose debug information has been stripped.