[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Syntactic sugar for function calls
- From: Rob Kendrick <rjek@...>
- Date: Sun, 23 Feb 2003 23:51:01 +0000
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