cps & contification

Henry Cejtin henry@sourcelight.com
Wed, 24 Jan 2001 14:56:55 -0600


I'm  clearly  way  way behind on all this contification discussion.  Can some
one tell me why we don't allow mutually recursive  continuations,  especially
given  that we clearly DO allow simply recursive ones (otherwise we would not
get loops).

To give a stupid example, if I have something like

    local fun even x =
                 if x = 0
                    then true
                    else odd (x - 1)
          and odd x =
                 if x = 0
                    then false
                    else even (x - 1)
    in fun f (flag, x) =
              if flag
                 then even x
                 else odd x
    end

Am I pimped to have calls to f do further full function calls?   (I  guess  I
can be saved if MLton decides to inline even in odd and vice versa so that it
turns into two separate loops, but even if they were huge I would want that.)