[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Monkey Patching is Bad, Unless Really Needed (was Re: A guide to building Lua modules)
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 17 Apr 2014 13:30:23 +0200
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.
- References:
- Monkey Patching is Bad, Unless Really Needed (was Re: A guide to building Lua modules), steve donovan
- Re: Monkey Patching is Bad, Unless Really Needed (was Re: A guide to building Lua modules), Hisham
- Re: Monkey Patching is Bad, Unless Really Needed (was Re: A guide to building Lua modules), Dirk Laurie
- Re: Monkey Patching is Bad, Unless Really Needed (was Re: A guide to building Lua modules), Hisham
- Re: Monkey Patching is Bad, Unless Really Needed (was Re: A guide to building Lua modules), Philipp Janda