mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Add another example of function call without parens
Function calls using a table literal as its sole parameter may also omit parentheses
This commit is contained in:
parent
6c53c05dcc
commit
57e0ac7e95
@ -136,6 +136,10 @@ local g; g = function (x) return math.sin(x) end
|
||||
-- Calls with one string param don't need parens:
|
||||
print 'hello' -- Works fine.
|
||||
|
||||
-- Calls with one table param don't need parens
|
||||
-- either (more on tables below):
|
||||
print {} -- Works fine too.
|
||||
|
||||
|
||||
----------------------------------------------------
|
||||
-- 3. Tables.
|
||||
|
Loading…
Reference in New Issue
Block a user