Code Snippets Pony

Short texts Pony 🧑‍💻 Code snippets Pony ✍️ Reading lists Pony 👀

Shared via Pony Playground (https://playground.ponylang.io/?gist=5b14c9f5c4e3a712a76d24db661ab2d3)

actor CounterActor var count: U64 = 0 be incr() => count = count + 1 be print(env : Env) => env.out.print(“Count:” + count.string()) class val Context let _env: Env let actor_count: CounterActor = CounterActor new val create(env: Env) => _env = env fun print_actor_count() => actor_count.print(_env) actor ExampleActor new create(ctx: Context) => ctx.actor_count.incr() ctx.print_actor_count() actor […]