mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 22:46:30 +00:00
24 lines
871 B
Plaintext
24 lines
871 B
Plaintext
|
|
fn print(msg: string) #[builtin(Print)] {}
|
|
fn println(msg: string) { print(msg + "\n") }
|
|
|
|
fn int_to_string(number: int) -> string #[builtin(IntToString)] {}
|
|
|
|
fn string_push_char(str: string, value: int) -> string #[builtin(StringPushChar)] {}
|
|
fn string_length(str: string) -> int #[builtin(StringLength)] {}
|
|
fn string_to_int(str: string) -> int #[builtin(StringToInt)] {}
|
|
|
|
fn array_new_string() -> [string] #[builtin(ArrayNew)] {}
|
|
fn array_new_int() -> [int] #[builtin(ArrayNew)] {}
|
|
fn array_push_string(array: [string], value: string) #[builtin(ArrayPush)] {}
|
|
fn array_push_int(array: [int], value: int) #[builtin(ArrayPush)] {}
|
|
fn array_length_string(array: [string]) -> int #[builtin(ArrayLength)] {}
|
|
fn array_length_int(array: [int]) -> int #[builtin(ArrayLength)] {}
|
|
|
|
|
|
|
|
fn main() {
|
|
let array = array_new_int();
|
|
array_push_int(array, 22);
|
|
array[0] = 5;
|
|
} |