lua-users home
lua-l archive

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


On Fri, Mar 28, 2014 at 1:25 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2014-03-28 22:11 GMT+02:00 Coroutines <coroutines@gmail.com>:
>
>> Personally I kinda wish people would just write string.find() rather
>> than making a local sfind(), much easier to notice when things
>> disappear.
>
> Well, for the string functions one can always use object-oriented
> notation. The point about caching library functions locally is
> that your module now has them and they are protected against
> the program that requires them. That idiot can do table = nil or
> _ENV={}, but it is not your module that mysteriously seems to
> break.
>

I do understand the perks to keeping local references, but I just get
annoyed when I'm making a modification to the original global
reference from elsewhere and third-party code doesn't make use of it
:-)  I like being able to affect the world, haha