As long as I'm mining his site, I thought I'd link to the more involved series that Jim Weirich put together that serves as nice introduction to continuations. In conjunction with Dan Sugalski's talks about Continuations, CPS, TailRecursion, and more, I might just be able to figure out how to get the CallCC function to work in my unlambda interepreter. :-)
PragDave has put together some programming "practice" exericises that he calls Katas. In Kata number two he suggests writing a binary search function, not once, but five different ways. Now I’ve implemented a binary search several times, but writing it five times in five different ways was intriguing.
- Iterative with Loop Invariants
- Recursive
- Recursive with Explicit Limits
- Continuation Passing Style
- Eliminating Tail Recursion
The series of implementations given is a nice perspective on the different styles used solving the same problem - thus giving a fair basis for comparison.
Posted to OOP by Chris Rathman on 8/31/03; 8:52:54 PM
|
|