lua-users home
lua-l archive

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


I'm not really proposing anything.  I was merely commenting on the syntax to me is more suggestive of a function wrapping feature over the originally proposed feature.  My example was more to show what I'd expect the syntactic sugar would do, not propose what it should do.

With all due respect to OP, I personally don't feel like saving two characters "()" warrants a new syntax, especially when the syntax resembles a different meaning.

On Thu, Jun 11, 2015 at 10:12 AM Patrick Donnelly <batrick@batbytes.com> wrote:
On Thu, Jun 11, 2015 at 11: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.  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

Please no! This type of magic is not something that should be
encouraged. The cost of creating the closure is very real and should
not be concealed through syntactic sugar like this.

[https://www.python.org/dev/peps/ is leaking.]

--
Patrick Donnelly