self[pos] = item
end
+ redef fun insert_all(coll, pos)
+ do
+ var l = coll.length
+ if l == 0 then return
+ enlarge(length + l)
+ _length += l
+ copy_to(pos, length-pos-l, self, pos + l)
+ for c in coll do
+ self[pos] = c
+ pos += 1
+ end
+ end
+
redef fun add(item) do self[length] = item
redef fun clear do _length = 0
# Access are unchecked and it has a fixed size
# Not for public use: may become private.
universal NativeArray[E]
+ # Creates a new NativeArray of capacity `length`
+ new(length: Int) is intern
# The length of the array
fun length: Int is intern
# Use `self` to initialize a standard Nit Array.
- Runtime error: Cast failed. Expected `NativeArray#0`, got `Bool` (../lib/standard/collection/array.nit:753)
-Runtime error: Cast failed. Expected `NativeArray#0`, got `Bool` (../lib/standard/collection/array.nit:742)
++Runtime error: Cast failed. Expected `NativeArray#0`, got `Bool` (../lib/standard/collection/array.nit:755)
NativeString
N
Nit