lua-users home
lua-l archive

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


> i was a bit confused by the word 'deprecated' as I usually understood
> this as "it is still functional, but should not be used for new code".
> But in Lua 5.2.0-work3 the functions ipairs, set/getfenv, log10,
> table.maxn actually raise an error so I would call them 'disabled'
> rather than 'deprecated'. You can put most of them back in with a
> define, but I guess the standard compilation is what matters. Otherwise
> I would reverse the define so you have to explicitly exclude deprecated
> functions.
> 
> Without the compatibility mode the functions still exist but throw an
> error ("'ipairs' deprecated"). Is this special error necessary instead
> of the default error ("attempt to call global 'ipairs' (a nil value)")?
> If the functions were removed entirely you could check their
> functionality using "if ipairs then ... end". This does not work when
> there is a function that just throws an error. (You could check it with
> 'pcall', but I would prefer a simple 'if').
> 
> For the compatibility compilation of Lua 5.2.0 I would prefer it if the
> old behavior of ipairs was kept (stopping at the first nil). But this
> was already mentioned by others.

Probably the final version will come with all (most) compatibilities on,
but for the work versions we are trying to "force" people to note the
differences. (work versions are not for the "general audience" ;)

-- Roberto