Skip to content

Instantly share code, notes, and snippets.

@lihaoyi
Created April 21, 2013 17:19

Revisions

  1. lihaoyi created this gist Apr 21, 2013.
    23 changes: 23 additions & 0 deletions gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    var x

    println("reset{} " +
    reset{

    shift{ cont: (Int => Int) =>
    println("cont(1): " + cont(1))
    println("cont(2): " + cont(2))
    5
    }
    )
    10
    }
    )

    (pp
    (call/cc
    (lambda (cont)
    (pp (cont 1))
    (pp (cont 2))
    )
    )
    )