Lua 为什么使用';)';调用函数的时候?
我有密码:Lua 为什么使用';)';调用函数的时候?,lua,Lua,我有密码: function output( string ) print( string ) end output 'Hola!' -- Why do I not need `(` and `)` here? 什么时候我不需要使用Lua语言中的(。检查: 如果函数只有一个参数,且该参数是文字字符串或表构造函数,则括号是可选的: print "Hello World" print("Hello World") dofile 'a.lua'
function output( string )
print( string )
end
output 'Hola!' -- Why do I not need `(` and `)` here?
什么时候我不需要使用Lua语言中的(
。检查:
如果函数只有一个参数,且该参数是文字字符串或表构造函数,则括号是可选的:
print "Hello World" print("Hello World")
dofile 'a.lua' dofile ('a.lua')
print [[a multi-line print([[a multi-line
message]] message]])
f{x=10, y=20} f({x=10, y=20})
type{} type({})