Christopher Allan Webber

Bumping into the tortoise and hare

Christopher Allan Webber at

Today, while debugging some Guile code that was embedded in a call to map, I moved up the stack at the REPL and saw that I the variables hare, tortoise, and move were bound. I figured something interesting was going on, and after a bit of investigation, I realized that map was doing a bit of cycle detection through the tortoise and hare algorithm. Fun!

Erez Schatz, Douglas Perkins, AJ Jordan likes this.