To create reusable functions, it would help to allow default values in parameters.
Example:
%CreateEffect(pos, type? = Ring, color? = White)
Create Effect
Visible_To: Everyone
Type: type
Color: color
Position: pos
Radius: 1.5
Reevaluation: Visible To
Adding ? to the end of the parameter will define it as an optional parameter. I pulled a page from the TypeScript book for this one. I like that because now we can detect when optional parameters are there and if it's not set...set it to null. So we can loosely have more control.
This would also make it so where the code is more like, "look bro, we have 3 parameters but only 1 is really required. As long as you give us the required...we're good." So instead of essentially counting and determining if we should use default values, we know when parsing the function initially when to consider them optional.
To create reusable functions, it would help to allow default values in parameters.
Example:
Adding
?
to the end of the parameter will define it as an optional parameter. I pulled a page from the TypeScript book for this one. I like that because now we can detect when optional parameters are there and if it's not set...set it to null. So we can loosely have more control.This would also make it so where the code is more like, "look bro, we have 3 parameters but only 1 is really required. As long as you give us the required...we're good." So instead of essentially counting and determining if we should use default values, we know when parsing the function initially when to consider them optional.