public
Created

  • Download Gist
gistfile1.as
ActionScript
1 2 3 4 5 6 7 8 9
function doMath( x: Float, y: Float, operation: Float -> Float -> Float ) {
return operation( x, y );
}
 
function swapDivide( swap: Bool, x: Float, y: Float ) {
return swap ? y / x : x / y;
}
 
doMath( 10, 2, function(x, y) { return swapDivide(true, x, y); } ); // returns 0.2

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.