Skip to content

Instantly share code, notes, and snippets.

@refractalize
Created October 15, 2012 21:58
Show Gist options
  • Save refractalize/3895835 to your computer and use it in GitHub Desktop.
Save refractalize/3895835 to your computer and use it in GitHub Desktop.
Continuations in Pogoscript
exports.current (callback) =
continuation () =
callback (nil, continuation)
callback (nil, continuation)
continuations = require './continuations'
n = 0
next = continuations.current! ()
n = n + 1
console.log (n)
if (n < 10)
next ()
1
2
3
4
5
6
7
8
9
10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment