Make REPL stateful. This is slightly hacky, but is as clean as I can make it. Essentially, resume now can take a segment, and if it does then it'll enter that segment but copy over the old stack contents. This is the best solution given that there's no guarantee the previous command will exit from the outer (root) segment or stack given tail calls, callcc and friends