summaryrefslogtreecommitdiff
path: root/test/files/continuations-run/ifelse1.scala
blob: 6f52a8c1e37a006ba9ad14a3728b342a87c28116 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// $Id$

import scala.util.continuations._


object Test {
 
  def test1(x:Int) = if (x <= 7)
    shift { k: (Int=>Int) => k(k(k(x))) }
  else
    x
  
  def test2(x:Int) = if (x <= 7)
    x
  else
    shift { k: (Int=>Int) => k(k(k(x))) }

  def main(args: Array[String]): Unit = {
    println(reset(1 + test1(7)))
    println(reset(1 + test1(8)))
    println(reset(1 + test2(7)))
    println(reset(1 + test2(8)))
  }
  
}