"Assertion":
if ( !expression )
{
// possibly display an error
// error( x );
return;
// instead, possibly return a value to parent function to abort as well
// return x;
}
"Add a variable to a class instance at runtime":
x.y = z;
"Higher-order functions":
function first( %x )
{
return call( %x );
}
function second()
{
return "foobar";
}
==>echo( first( second ) );
foobar
"Include a file":
exec("path/to/file.cs");
"Singletons":
singleton ShaderData( SSAOShader )
{
DXVertexShaderFile = "shaders/common/postFx/postFxV.hlsl";
DXPixelShaderFile = "shaders/common/postFx/ssao/SSAO_P.hlsl";
pixVersion = 3.0;
};
"Reverse a string":
function stringReverse( %string )
{
%result = "";
for ( %i = strLen( %string ) - 1 ; %i >= 0 ; %i-- )
{
%result = %result @ getSubStr( %string, %i, 1 ),
}
return %result;
}
"Binary string":
"\xFA\x62"