lua-users home
lua-l archive

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


A good question. Arguably the second form would be very useful for
class definitions. But table constructors currently only take values,
like the anonymous function in the first example.

steve d.

On Thu, Feb 21, 2008 at 3:30 AM, Tim Hunter <TimHunter@nc.rr.com> wrote:
> Why does this work:
>
>  t = {
>     f = function()
>             print("hello")
>         end
>  }
>
>  But this doesn't?
>
>  t = {
>     function f()
>         print("hello")
>     end
>  }
>
>
>