Skip to content

Instantly share code, notes, and snippets.

@christineponyl
Created October 18, 2019 16:24
Show Gist options
  • Save christineponyl/b9bc8e53ff243eef90525c6d5688b0f3 to your computer and use it in GitHub Desktop.
Save christineponyl/b9bc8e53ff243eef90525c6d5688b0f3 to your computer and use it in GitHub Desktop.
actor Main
let pa: PrintingActor
new create(env: Env) =>
pa = PrintingActor(env.out)
env.out.print(fib(5).string())
fun fib(n: U64): U64 =>
match n
| 0 => 0
| 1 => 1
else
let n1 = n - 1
let n2 = n - 2
pa.debugger(n.string()) // -I need to print right here
fib(n - 1) + fib(n - 2)
end
actor PrintingActor
let _out: OutStream
new create(out: OutStream) =>
_out = out
be debugger(n: String) =>
_out.print(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment