|
@@ -33,6 +33,8 @@ private typedef VectorData<T> = #if flash10
|
|
cs.NativeArray<T>
|
|
cs.NativeArray<T>
|
|
#elseif java
|
|
#elseif java
|
|
java.NativeArray<T>
|
|
java.NativeArray<T>
|
|
|
|
+#elseif lua
|
|
|
|
+ lua.Table<Int,T>
|
|
#else
|
|
#else
|
|
Array<T>
|
|
Array<T>
|
|
#end
|
|
#end
|
|
@@ -71,6 +73,9 @@ abstract Vector<T>(VectorData<T>) {
|
|
this.setSize(length);
|
|
this.setSize(length);
|
|
#elseif python
|
|
#elseif python
|
|
this = python.Syntax.pythonCode("[{0}]*{1}", null, length);
|
|
this = python.Syntax.pythonCode("[{0}]*{1}", null, length);
|
|
|
|
+ #elseif lua
|
|
|
|
+ this = lua.Boot.createTable();
|
|
|
|
+ untyped this.length = length;
|
|
#else
|
|
#else
|
|
this = [];
|
|
this = [];
|
|
untyped this.length = length;
|
|
untyped this.length = length;
|
|
@@ -301,6 +306,8 @@ abstract Vector<T>(VectorData<T>) {
|
|
public inline function sort<T>(f:T->T->Int):Void {
|
|
public inline function sort<T>(f:T->T->Int):Void {
|
|
#if (neko || cs || java)
|
|
#if (neko || cs || java)
|
|
throw "not yet supported";
|
|
throw "not yet supported";
|
|
|
|
+ #elseif lua
|
|
|
|
+ haxe.ds.ArraySort.sort(cast this, f);
|
|
#else
|
|
#else
|
|
this.sort(f);
|
|
this.sort(f);
|
|
#end
|
|
#end
|