# 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.
# Native strings are simple C char *
extern class NativeString `{ char* `}
super StringCapable
-
+ # Creates a new NativeString with a capacity of `length`
+ new(length: Int) is intern
fun [](index: Int): Char is intern
fun []=(index: Int, item: Char) is intern
fun copy_to(dest: NativeString, length: Int, from: Int, to: Int) is intern
# See the License for the specific language governing permissions and
# limitations under the License.
-redef class NativeArray[E]
- new(length: Int) is intern
-end
-
-redef class NativeString
- new(length: Int) is intern
-end
-
var s = new NativeString(4)
s[0] = 'N'
s[2] = 't'