Playing Dice with the Universe

[Part 11 of the FScheme series] We’re now taking the first small step into the world of nondeterministic logic programming (chapter 16 of Bill Hails’ book). Hopefully you enjoyed the last post about continuation passing and found the idea to be ripe with potential power; indeed so powerful that we’re going to use it now…

0

Turning Your Brain Inside Out with Continuations

[Part 10 of the FScheme series] We’re into one of the most magical chapters in Bill Hails’ book. We’re about to add a very strange and dangerous feature to the interpreter: ‘call/cc’ (“call with current continuation”). To appreciate the beauty of it, we’ll first look at continuation passing style (CPS) in general, what it’s good…

7

Monadic Piles of Coconuts

After reading the “coconut” problem over on my friend’s blog, I thought it would be fun to solve it with a silly brute force approach. First, go read his post and then come back here. let take n =     let m = n – 1 // give one to the monkey     if m…

0