Enables monkey's Strict syntax mode.
Strict
By default, Monkey allows you to take certain shortcuts when programming. However, Monkey also offers a special Strict mode for programmers who prefer a stricter language definition.
The differences between the Strict and non-Strict modes are:
While syntax is shown in Strict mode, the examples in this documentation will normally be presented in non-Strict form.
Return | Int | Float | String | Bool | Void
Strict
' In Strict mode...
Function
Main
:
Int
()
' the :Int type definition is compulsory...
Print
(
"Strict mode is...different!"
)
' all function calls require brackets...
Return
0
' and we MUST return a value.
End
' Non-Strict version of first example, declaring no Return
' type, no brackets for Print statement and no Return value.
Function
Main
()
Print
"Non-Strict mode is...forgiving!"
End