Created
March 6, 2013 11:27
-
-
Save SimonRichardson/5098692 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ; | |
typedef Function2Type<T1, T2, R> = T1 -> T2 -> R; | |
abstract Function2<T1, T2, R>(Function2Type<T1, T2, R>) from Function2Type<T1, T2, R> to Function2Type<T1, T2, R> { | |
inline function new(func : Function2Type<T1, T2, R>) { | |
this = func; | |
} | |
} | |
class Main { | |
public static function main() : Void { | |
var func : Function2<Int, Int, Int> = function(a, b) return a + b; | |
trace(func(1, 2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment