lua-users home
lua-l archive

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


On Tue, Jul 01, 2003 at 09:51:01AM -0700, Curt Carpenter wrote:
> How come this works:
> 	print "Hello World"
> But this doesn't:
> 	print 5
> What's wrong with saying that all function invocations must use the
> parenthetical arg list syntax?

Basically as a slight nod toward simplicity, functions can take either a
single table or a single string rather than an argument list, so:

blahfoo { 12, 45, a = "Hello" };

is valid, as is

print "Hello World"

Otherwise, you have to use the parentheses to enclose the argument list,
I.E.:

print(5)

D.

-- 
Daniel Silverstone                               http://www.digital-scurf.org/
Hostmaster, Webmaster, and Chief Code Wibbler          Digital-Scurf Unlimited
GPG Public key available from keyring.debian.org               KeyId: 20687895
You may be recognized soon.  Hide.