lua-users home
lua-l archive

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


>I was playing around with calling functions without the brackets, if
>they take only one parameter, and it is a string or table this evening.
>
>  function user(t)
>    ...
>  end
>
>  user { name = "Joe Bloggs", password = "wibble" }
>
>Works, where adding another function, say:
>
>  function hosts(t)
>    ...
>  end
>
>  user { name = "Joe Bloggs", hosts { "jbloggs.bigco.com" } }
>
>Does not.  Which seems a shame.  Is it me just getting something rather
>stupidly wrong, or can I not do this?  Is there an alternative method in
>the same vain?  (this is for a configuration file.)

In what sense does this second example not work? Perhaps hosts should return t?
--lhf