[haXe] Passing functions as parameters query

Nicolas Cannasse ncannasse at motion-twin.com
Mon Apr 3 09:18:58 CEST 2006


> hey ,
>         I am having some trouble figuring out how to pass functions as
> parameters

Functions are variables like others :

function hello( func : String -> Void ) {
    func("hello");
}

function print( s : String ) {
    trace(s);
}

function test() {
    hello(print);
}

Nicolas



More information about the Haxe mailing list