Print works without brackets...
Community Forums/Monkey2 Talk/Print works without brackets...
| ||
According to http://monkey2.monkey-x.com/2015/09/09/monkey1-to-monkey2/ "Function call parameters must be enclosed in parenthesis", but at the moment Print can be used with or without parentheses: |
| ||
Would Print be considered a function or a statement? I've always considered it to be the latter as part of the core language that outputs directly to standard out and only excepts one parameter and one data type; non string types where possible get automatically recast to strings. Hench no need to emphasise that fact with parentheses, Where as modules are extensions and typically contain functions/method with variable naming that can have multiple parameters with various data types. I would think that enclosing these with parentheses would make it much easer to parse. If Print was doing more say like formatting output. Then I would expect it to have parentheses. But then only Mark himself can tell you why parentheses are optional with Print. |