lua-users home
lua-l archive

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


On Thu, Jun 11, 2015 at 10:15 AM, Christopher Tallman
<cjtallman@gmail.com> wrote:
> To me, this particular syntax doesn't look like a function call. It looks
> more like an rvalue.

same here.  it's a slippery slope from there to something like moonscript.


>  For what it's worth, I think I would prefer to reserve
> that syntax for something like wrapping/anonymizing a "method" function. ie:
>
>   local myFunc = self:theirFunc
>
> The above being equivalent to:
>   local myFunc = function(...) self:theirFunc(...) end

I've been known to use things like:

    function bind(o,m)
        local f = o[m]
        return function(...) return f(o, ...) end
    end



-- 
Javier