Object ownership
References share an object’s lifetime. An owning list can take responsibility for deleting its objects.
Read about ownershipA strongly typed language for systems programming. Control object lifetimes and express the states your objects can take.
using cloth.Console : println;
pub fn main() {
string[4] greetings := [
"Hello!", "¡Hola!",
"Jambo!", "こんにちは!"
];
for (def hello <- greetings)
println(hello);
}shuttle run helloHello!
¡Hola!
Jambo!
こんにちは!
References share an object’s lifetime. An owning list can take responsibility for deleting its objects.
Read about ownershipGive each state its own data and methods. Every instance of a class has one active state at a time.
Explore named states