slige/examples/generic_array.slg

22 lines
367 B
Plaintext
Raw Permalink Normal View History

2024-12-30 23:54:58 +00:00
mod std;
2024-12-26 01:38:32 +00:00
fn main() {
2024-12-30 23:54:58 +00:00
let strings = std::array_new::<string>();
std::array_push(strings, "hello");
std::array_push(strings, "world");
2024-12-26 01:38:32 +00:00
2024-12-30 23:54:58 +00:00
let ints = std::array_new::<int>();
std::array_push(ints, 1);
std::array_push(ints, 2);
for v in strings {
2024-12-30 23:54:58 +00:00
std::println(v)
}
for v in ints {
2024-12-30 23:54:58 +00:00
std::println(std::itos(v))
}
2024-12-26 01:38:32 +00:00
}