Skip to content

Instantly share code, notes, and snippets.

@ii-v
Created August 3, 2016 22:00
Show Gist options
  • Save ii-v/6a115b2f7b7efb57c805ad2f4ce04234 to your computer and use it in GitHub Desktop.
Save ii-v/6a115b2f7b7efb57c805ad2f4ce04234 to your computer and use it in GitHub Desktop.
actor Main
let person1: Person
let person2: Person
new create(env: Env) =>
person1 = Person("Jupiter", 17, "male)
env.out.print(person1.summary())
person2 = Person("Robert", 16, "male")
env.out.print(person2.summary())
class Person
let _name: String
let _age: I32
let _gender: String
new create(name: String, age: I32, gender: String) =>
_name = name
_age = age
_gender = gender
fun summary(): String =>
if gender is "male" then
"This person is called " + _name + " and he is " + _age.string() + " years old."
end
@SeanTAllen
Copy link

you error in this btw is that on line 6 that "male

isn't closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment