This commit is contained in:
nub31
2025-07-04 21:43:26 +02:00
parent 2ad6529350
commit 0e0f29c6dd
13 changed files with 453 additions and 377 deletions

View File

@@ -1,41 +1,39 @@
namespace main
struct Name
struct name
{
first: cstring
last: cstring
}
struct Human
struct human
{
name: Name
name: name
age: i64
}
interface Printable
trait printable
{
func print()
}
impl Human : Printable
impl printable for human
{
func print() {
c::puts(this.name)
c::puts(this.name.first)
}
}
export func main(args: []cstring): i64
{
let x = alloc Human
let human = alloc human
{
name = alloc Name {
name = alloc name {
first = "john"
last = "doe"
}
age = 23
}
x.print()
human.print()
return 0
}