Non-Strict Vs Strict
Monkey Forums/Monkey Programming/Non-Strict Vs Strict
| ||
Just a few quick examples of Non-Strict and Strict Code: *** Non-Strict: *** This fails with "Identifier 'x' not found": Function Main() x = 1 End This compiles: Function Main() local x x = 1 End *** Strict: *** This fails with "Syntax error": Strict Function Main() ' <--- Error here x = 1 End This fails with "Identifier 'x' not found": Strict Function Main:Int() x = 1 End This fails with "Syntax error": Strict Function Main:Int() local x ' <--- Error here x = 1 End This fails with "Missing return expression": Strict Function Main:Int() local x:Int x = 1 End This compiles: Strict Function Main:Int() local x:Int x = 1 return 0 End |
| ||
Very useful post, thanks for taking the time |
| ||
Much obliged. I am wanting to stay within the restrictions of Strict, so yes, very useful. |