lua-users home
lua-l archive

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


> What about accepting the ugly stuff if it comes inside parentheses,
> like in
> 
>     function (mylib.MyClass):method() ... end
> 
> contrasted to the problematic
> 
>     function mylib.MyClass:method() ... end


This last form is not problematic. What is problematic is function calls. 
This solution with parentheses has the advantage that you can write 
anything inside it; the bad side is that you must put the parentheses. The 
"just-one-more-teaspoon" solution allows only more dots, but does someone 
needs more than that? Of course, we can have both! Allow multiple dots 
without parentheses, and just anything with them. But the point is: do
people really need this? Belmonte showed a real common case for multiple
dots. How frequent do we need to declare something like this?

  function a(x).foo (y) ... end


-- Roberto