Skip to content

Instantly share code, notes, and snippets.

@rprtr258
Last active April 20, 2021 12:08
Show Gist options
  • Save rprtr258/951d257813d499c0dd86174fe70dc3f2 to your computer and use it in GitHub Desktop.
Save rprtr258/951d257813d499c0dd86174fe70dc3f2 to your computer and use it in GitHub Desktop.
cps
def nop(*args): pass
def f(n, e=lambda f:f()):
print(f"f#{n} started")
def cont(k=nop):
print(f"f#{n} ended")
k()
e(cont)
f(1, lambda cont: f(2, lambda cont2: cont(cont2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment