[racket] Finite State Machines of Arbitrary Size using Racket's composable control

From: Stephen Bloch (bloch at adelphi.edu)
Date: Thu May 24 12:28:37 EDT 2012

On May 24, 2012, at 11:59 AM, Eli Barzilay wrote:

> More than a week ago, Galler wrote:
>> This code was generated in response to the user who sought to
>> implement run-length encoding of a bit-vector on Sunday night.
>> [...]
>> Its a good 10 second answer to "what can you do with composable control"
>> that would be impossible in its absence?
> Note that the FSM part of your code always passes around a simple tail
> continuation, which means that you could just use tail calls to do the
> same.

I included a couple of problems in _Picturing Programs_ (section 22.5 and perhaps 22.7) intended to lead students to this approach to FSM's.  Unfortunately, since I added those problems, I haven't had any students who actually got to those problems (this semester's CS0 class only touched on lists for a week, and last semester's didn't get to lists at all), so I don't know how those problems actually work in the classroom.  Anybody out there who's tried them?

Stephen Bloch
sbloch at adelphi.edu

Posted on the users mailing list.