Created
May 5, 2015 13:14
-
-
Save oakfang/b39e46f4fab2ab1f63bb to your computer and use it in GitHub Desktop.
My first pony script
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
interface Shouter | |
fun shout(env: Env) | |
class Person | |
let name: String | |
var age: U8 | |
new create(name': String, age':U8) => | |
name = name' | |
age = age' | |
new birth(name': String) => | |
name = name' | |
age = 0 | |
fun shout(env: Env) => | |
env.out.print(name) | |
actor Main | |
new create(env: Env) => | |
shout_out(get_person(), env) | |
fun get_person(): Person => Person.birth("Alon") | |
fun shout_out(shouter: Shouter, env: Env) => shouter.shout(env) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment