Sun Oct 30 10:49:52 EDT 2011

Delimiting Let

Shuffled things around a bit.  The main idea is to run a code
generation computation MCode (Code t) in an isolated context to avoid
Let insertion to grab beyond the current expression point, as it
manipulates the top continuation.

The interface:

subTerm s (SC c) = c s $ \s (Code t) -> t
term = subTerm (CompState 0)

mBlock :: MCode (Code t') -> MCode (Code t)
mBlock sub = SC main where
  main s k = k s $ Code $ (subTerm s sub)

Running an isolated compilation is then:

  (Code term) <- mBlock mCode