30 lines
352 B
Plaintext
30 lines
352 B
Plaintext
namespace main
|
|
|
|
struct Name {
|
|
first: cstring
|
|
last: cstring
|
|
}
|
|
|
|
struct Human
|
|
{
|
|
name: Name
|
|
age: i64
|
|
}
|
|
|
|
export func main(args: []cstring): i64
|
|
{
|
|
let x: Human
|
|
|
|
x = alloc Human {
|
|
name = alloc Name {
|
|
first = "john"
|
|
last = "doe"
|
|
}
|
|
age = 23
|
|
}
|
|
|
|
c::puts(x.name.last)
|
|
|
|
return 0
|
|
}
|