Created
August 3, 2016 22:00
-
-
Save ii-v/6a115b2f7b7efb57c805ad2f4ce04234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you error in this btw is that on line 6 that "male
isn't closed