Re: Unclear % operation for counting
Posted: Tue Feb 14, 2023 2:58 am
name=function() end; is the _pure_ form of creating a function and assigning a name to it.
function name() end; is annoying syntax sugar for the same line that was added for people with no taste.
And the other thing is syntax hell based on two grounds:
Lua does sometimes not care about newlines, and sometimes it does, have fun finding it out.
The () brackets are optional when calling a function.
The code your quoted there is a function call to StateMachine with a table as argument.
Now dont get me started on comments, [[ can be used for strings, comments and logical comment blocks.
function name() end; is annoying syntax sugar for the same line that was added for people with no taste.
And the other thing is syntax hell based on two grounds:
Lua does sometimes not care about newlines, and sometimes it does, have fun finding it out.
The () brackets are optional when calling a function.
The code your quoted there is a function call to StateMachine with a table as argument.
Code: Select all
print('bla') -- tutorial form
print"bla" --valid
print"bl
a" --invalid
print
"bla" --valid, but heck, why?
print[[bl
a]] --valid
print{} --valid but useless