Void, Strict, and Non-Strict

Monkey Forums/Monkey Programming/Void, Strict, and Non-Strict

Dylan at sea(Posted 2012) [#1]
Hello,

Similar to how one can declare (return) types in non-strict mode with $, %, or ?, for example, is there similar shorthand for Void?

For background, I want to do this in non-strict mode:
Function DoSomething()
...and have it mean this in strict mode:
Function DoSomething:Void()

I recognize it's actually more like these, which is not intuitive to me.
Function DoSomething%()
Function DoSomething:Int()

I would expect Function DoSomething() to return Void in non-strict mode.

Thank you!


ziggy(Posted 2012) [#2]
If you do not set a return value type it is considered Int, not Void. That's by language design.


MikeHart(Posted 2012) [#3]
Personally I ALWAYS use strict mode. Says me a lot of headache for missdefined fields and variables.


Paul - Taiphoz(Posted 2012) [#4]
I would also recommend always working in strict mode it will save you so much time in the long run as well as making your life a lot easier when it comes to debugging.


Dylan at sea(Posted 2012) [#5]
I guess my question was whether there was similar shorthand for Void.


MikeHart(Posted 2012) [#6]
Not to my knowledge.