呼び出し元のスタックフレームまで記憶しているのがワケワカ。
継続とコルーチンは違うのね…
def coroutine loop do puts '春' continue = callcc {|c| c } and return(continue) puts '夏' continue = callcc {|c| c } and return(continue) puts '秋' continue = callcc {|c| c } and return(continue) puts '冬' continue = callcc {|c| c } and return(continue) end end while (c = coroutine) gets c.call end