How to do things in both.
vector.push_back(value);dynamic_array += value;
std::insert(vector.begin(), value);dynamic_array ~= value;
std::insert(vector.begin() + index, value);dynamic_array[index] += value;
vector.at(index);@dynamic_array[index];
for (auto elem : vector) {}for elem in dynamic_array, {};
for (auto i = 0; i < vector.size(); ++i) {}cfor
i :: 0;
i < dynamic_array.size();
i += 1;
{}
std::print("{}", value);print value;
std::print("{}\n", value);
std::println("{}", value);
std::cout << value << '\n';
std::cout << value << std::endl;print value, `\n`;
std::variant<int, char>;
std::variant<int, char> foo;
foo = 420;
static_assert(std::variant_size_v<decltype(foo)> == 2);
if (std::holds_alternative<int>(foo)) {
std::println("69");
} else if (std::holds_alternative<char>(foo)) {
std::println("42");
} else std::exit(1);;; Note: Glint's sum type can represent multiple members of the same type,
;; distinguished by name.
sum { x : int; y : int; z : byte; };
foo : sum { x : int; y : int; z : byte; };
foo.y := 420;
;; `match` already staticly asserts all members are handled.
match foo, {
.x print 69;
.y print foo.y;
.z print 42;
};