Using Null in a Function

Monkey Forums/Monkey Programming/Using Null in a Function

Chroma(Posted 2013) [#1]
In BMax we could use Null in a function like this:

Function AddVec(v:Vec2 = Null)
End Function


This made is so putting in the "v" Type optional. How do we do it in Monkey?


MikeHart(Posted 2013) [#2]
Works the same in Monkey.


DruggedBunny(Posted 2013) [#3]
Yeah, this works here...


Class Vec2
	Field x:Float
End

Function AddVec(v:Vec2 = Null)
End

Function Main ()
	AddVec
	AddVec (New Vec2)
End