mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 18:16:31 +00:00
20 lines
467 B
Plaintext
20 lines
467 B
Plaintext
//
|
|
|
|
fn array_new<T>() -> [T] #[builtin(ArrayNew)] {}
|
|
fn array_push<T>(array: [T], value: T) #[builtin(ArrayPush)] {}
|
|
fn array_length<T>(array: [T]) -> int #[builtin(ArrayLength)] {}
|
|
fn array_at<T>(array: [T], index: int) -> string #[builtin(ArrayAt)] {}
|
|
|
|
|
|
fn main() {
|
|
let strings = array_new::<string>();
|
|
array_push(strings, "hello");
|
|
array_push(strings, "world");
|
|
|
|
let ints = array_new::<int>();
|
|
array_push(ints, 1);
|
|
array_push(ints, 2);
|
|
}
|
|
|
|
|