irScript supports invocation of function objects and member functions, using a named reference to the function.
function myFunc ( arg1 ) { return arg1.ToString(); }
var x = myFunc( 34 );
var y = { MyMemberFunc : myFunc };
var z = y.MyMemberFunc( [true, false, 34.4] );
All function calls in irScript return a value; functions that don’t return an explicit value implicitly return null, the value of which can be safely ignored.
function someFunc ( arg ) { arg.Name = 'Fred'; }
var x = { Age : 78 };
var y = someFunc( x ); // y == null
Comments
0 comments
Please sign in to leave a comment.