I have the code:
function output( string )
print( string )
end
output 'Hola!' -- Why do I not need `(` and `)` here?
When do I not need to use (
in the Lua
language.
Check the documentation:
If the function has one single argument and this argument is either a literal string or a table constructor, then the parentheses are optional:
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({})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With