May 2005 Blog Posts

Continuation Style Passing

Don Box made another post on Continuations and Closures that made me realised I’d made a mistake in my last post. I had not used continuation; I merely used a closure that captured some mutable variables. Also F#/Caml does not have continuations in the same way Ruby does. F# does however have continuation style passing, also discussed in Mr. Box aforementioned post.   Anyway I thought I’d write a sort piece to show continuation style passing in action in F# , using my old favourite the Fibonacci series. Consider the following recursive code function that calculated the...