lua-users home
lua-l archive

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


On Wed, Nov 17, 2010 at 05:40, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Wed, Nov 17, 2010 at 12:28 PM, Philippe Lhoste <PhiLho@gmx.net> wrote:
>> task dataLoad(dependsOn: codeGen) << {
>>  println 'dataLoad'
>> }
>>
>> There is a family look...
>
> A useful spoon of syntactical sugar here would be this:
>
> task.dataLoad 'codeGen' begin
>   ....
> end
>
> The block begin..end after a function call translates to (function()
> ... end), or perhaps is even included as the last argument to the call
> (which is how Boo handles it)
>

In Lua the following snippet

task.dataLoad( 'codeGen',  function()
   ....
end)

will do the same. No need  for extra syntactic sugar. Right semantics
is already there.

--Leo--