lua-users home
lua-l archive

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


from Sol Diffs2Lua:

>>>
- Removed the implicit self parameter in function definitions of the
  special form function foo:bar(...)...end.  You have to name _all_
  arguments.

    function foo:bar(a,b,c) --> function foo:bar(self,a,b,c)
<<<

I have to agree with Edgar here.  What is the point of an implicit self in the parameter list
when in the function we have to spell out member variable accesses anyway?  It's like the
monster child of C++ and Python.

>>>
- Vararg syntax has changed.  Instead of ... that generates an
  automatic arg parameter you now have to write name[].  So a
  vararg function looks like this:

    function foo:bar(...) --> function foo:bar(self, arg[])
<<<

I like this too.  However maybe a syntax like the following is better since it can be backwards
compatible with Lua if you allow the name to be omitted:

    function foo(x, y, arg...)

-John