lua-users home
lua-l archive

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


On Thu, Apr 17, 2014 at 12:57 PM, Philipp Janda <siffiejoe@gmx.net> wrote:
> So, IMHO, what makes this case different is that the monkey-patches are
> intended as conveniences for new code only, not to change the behavior of
> old code

Absolutely!

>   [*] almost (e.g. the return values of `os.exit` are incompatible)

That's when a disciplined patcher has to stop.  For Penlight, I got
around this by providing utils.execute and utils.load which have 5.2
semantics.  Plus, utils.getfenv is always defined, since kind people
pointed out that checking for existence of getfenv is a common enough
way to detecting 5.2.  The only global alterations left are that
table.pack and table.searchpath are added in 5.1.