Scala Continuations - Why can't my shifted call be inside a try-catch block?
问题 I'm new to Scala continuations, and relatively new to the scala language in general. I tried playing with Scala continuations and wrote the following code: case class MyException(msg:String) extends Exception def go:Int = reset { println("enter your input") val my_check = //try { val user_input = readLine() if (!user_input.matches("\\w+")) { throw new MyException("illegal string: " + user_input) } shift { k: (Boolean => Int) => { if (user_input == "true") { k(true) } else if (user_input ==