Skip to content

Instantly share code, notes, and snippets.

@jemc
Created March 18, 2016 20:11
Show Gist options
  • Save jemc/dff14f448faea7a922e4 to your computer and use it in GitHub Desktop.
Save jemc/dff14f448faea7a922e4 to your computer and use it in GitHub Desktop.
Pony example of just piping stdin to stdout.
actor Main
let env: Env
new create(env': Env) =>
env = env'
env.input(notify())
be print(data: ByteSeq val) =>
env.out.print(data)
fun tag notify(): StdinNotify iso^ =>
object iso is StdinNotify
let parent: Main = this
fun ref apply(data: Array[U8] iso) =>
parent.print(consume data)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment