[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [PROPOSAL] [PATCH] simple method call
- From: Javier Guerra Giraldez <javier@...>
- Date: Thu, 11 Jun 2015 10:40:56 -0500
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