...
This commit is contained in:
@@ -1,21 +1,21 @@
|
|||||||
struct name
|
struct Name
|
||||||
{
|
{
|
||||||
first: cstring
|
first: cstring
|
||||||
last: cstring
|
last: cstring
|
||||||
}
|
}
|
||||||
|
|
||||||
struct human
|
struct Human
|
||||||
{
|
{
|
||||||
name: name
|
name: Name
|
||||||
age: i64
|
age: i64
|
||||||
}
|
}
|
||||||
|
|
||||||
trait printable
|
trait Printable
|
||||||
{
|
{
|
||||||
func print()
|
func print()
|
||||||
}
|
}
|
||||||
|
|
||||||
impl printable for human
|
impl Printable for Human
|
||||||
{
|
{
|
||||||
func print() {
|
func print() {
|
||||||
c::puts(this.name.first)
|
c::puts(this.name.first)
|
||||||
@@ -24,9 +24,9 @@ impl printable for human
|
|||||||
|
|
||||||
func main(args: []cstring): i64
|
func main(args: []cstring): i64
|
||||||
{
|
{
|
||||||
let human = alloc human
|
let human = alloc Human
|
||||||
{
|
{
|
||||||
name = alloc name {
|
name = alloc Name {
|
||||||
first = "john"
|
first = "john"
|
||||||
last = "doe"
|
last = "doe"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user