lua-users home
lua-l archive

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


Hi,

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.)

Thanks for your time,
-- 
Rob Kendrick                                       http://www.pepperfish.net/
PGP signed or encrypted mail welcome                         Key ID: 3651D17A