Skip to content

Instantly share code, notes, and snippets.

@oakfang
Created May 5, 2015 13:14
Show Gist options
  • Save oakfang/b39e46f4fab2ab1f63bb to your computer and use it in GitHub Desktop.
Save oakfang/b39e46f4fab2ab1f63bb to your computer and use it in GitHub Desktop.
My first pony script
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