lua-users home
lua-l archive

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


Asko Kauppi wrote:

local string function dummy( table t, int i, optional int j, optional number n )
    ...
    local int x= i + (j or 0) + (n or 0)
    return string t[x]
   end

This syntax is ambiguous. It already have meaning

local string         -- new local variable
function dummy (...) -- new global function
...
end

I think Pascal-style is more suitable for Lua than C-style:

local function dummy(t:table, i:int, j:int?, n:int?):string
...
end

--
e.v.e