lua-users home
lua-l archive

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


On Sun, Mar 5, 2017 at 12:32 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:

> but the point is that you can't easily, by accident, call the write or close methods without a valid file argument in place. This makes code safer and cleaner.

As mentioned here, http://lua-users.org/lists/lua-l/2017-02/msg00009.html , you can actually call the close method without a valid argument very easily, producing errors that are difficult to diagnose at times.

Fact is, the difference between the dot and the colon is very confusing and much back-stabbing for Lua neophytes, especially for those with experience in other object-oriented languages, where the dot means exactly what Lua denotes by the colon. Such people tend to make this mistake even after years of using Lua, if it is not their primary language.

Cheers,
V.