feat: add examples of functions without parenthesis

This commit is contained in:
Ibrahim Abdulhameed committed 2025-09-01 12:59:35 +01:00
1 parent b5e1c92ad1
commit c56683d28d
1 file changed
+15
+15
View File
@@ -315,6 +315,21 @@ doAction('write', "Shirley", "Abed")
--> Doing 'write' to Shirley Abed
```
You can omit parentheses if the argument is one string or table literal
```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({})
```
## Data Type APIs
### Strings