lua-users home
lua-l archive

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


> On 14.7.2017, at 23.40, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
> In Lua, this
> is errorprone as it is a dynamic language - so an API that asks users
> to say file:write() helps the user to avoid mistakes.

Actually, how is file:write("abc") any less error prone than say shb_file_write(file, "abc")?  (Example from my Shinobi game engine)

In both cases it's just as easy to have a typo in "file" arg. Having the ':' in the OO case actually makes it more error prone because of the ':' vs. '.' syntax.

Petri