class Test {
    static function main() {
        var array:Array<Int> = [3, 5, 2, 1, 2, 3, 4];
        print("An Array of Ints", array);
        
        
    var copy = array.copy();
        copy.sort(function(a, b) {
           if(a < b) return -1;
           else if(a > b) return 1;
           else return 0;
        });
        print("Sort with array.sort()", copy);
        
        
    var copy = array.copy();
        haxe.ds.ArraySort.sort(copy, function(a, b) {
           if(a < b) return -1;
           else if(a > b) return 1;
           else return 0;
        });
        print("Sort with haxe.ds.ArraySort.sort()", copy);
    }
    
    // a function to print the second array
    static function print<T>(msg:String, a:Array<T>) {
        trace(msg);
        trace(a);
        trace("");
    }
}