|
Value > Special Data Values > Unsupplied Value |
The Unsupplied class implements the value used to initialize unsupplied keyword parameters to functions.
There is one distinguished instance of the Unsupplied class in the reserved system variable unsupplied .
You can test to see whether a caller has supplied an optional keyword argument by comparing it with unsupplied .
Constructor
Unsupplied
|
EXAMPLE |
fn testFunction arg1 optionalArg2: =
(
if optionalArg2 == unsupplied then
format "Optional Argument Was Not Supplied!\n"
else
format "Arguments Were Supplied, Their Sum Was %!\n" (arg1+optionalArg2)
)
testFunction 10.0
--> Optional Argument Was Not Supplied!
testFunction 10.0 optionalArg2:32
--> Arguments Were Supplied, Their Sum Was 42.0!
|