Skip to content

Instantly share code, notes, and snippets.

Created August 29, 2011 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1177551 to your computer and use it in GitHub Desktop.
Save anonymous/1177551 to your computer and use it in GitHub Desktop.
<amalloy> (doc trampoline)
<lazybot> => "([f] [f & args]); trampoline can be used to convert
algorithms requiring mutual recursion without stack consumption. Calls
f with supplied args, if any. If f returns a fn, calls that fn with no
arguments, and continues to repeat, until the return value is not a
fn, then returns that non-fn value. Note that if you want to return a
fn as a final value, you must wrap it in some data structure and
unpack it after trampoline returns."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment