This repository has been archived on 2025-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nub-lang-archive-2/example/main.nub
nub31 c3714af5f3 ...
2025-06-02 16:20:25 +02:00

38 lines
656 B
Plaintext

namespace main
struct Ape {
name: string
age: i64
}
struct Human {
parent: Ape
name: string
age: i64
}
export func main(args: []^string) {
// c::printf("%d\n", args.count)
// let i: i64
// while i < args.count {
// c::printf("%s\n", args[i])
// i = i + 1
// }
let human = alloc Human {
parent = alloc Ape {
name = "john"
age = 24
}
age = 23
name = "oliver"
}
c::printf("%s is %d years old\n", human.name, human.age)
c::printf("parent name is %s\n", human.parent.name)
// human.name = "hubert"
// human.age = 92
}