The IInvokable interface

SSharp S# API

DropDown image DropDownHover image Collapse image Expand image CollapseAll image ExpandAll image Copy image CopyHover image

Objects implementing the IInvokable interface will be treated as functions. Suppose there is a variable f in the function scope that implements IInvokable, then following S# code:

 
f(1,2,3);

 
will be interpreted as following in C# code:
 

IInvokable fi = f as IInvokable;
if (fi == null || !fi.CanInvoke()) throw exception;
return fi.Invoke(Context, new object[] {1,2,3});

 

See also:

Tutorial 2. Creating custom function