blob: ea58f8b9b0769db62fbd86c16ded77d4a24c3147 (
plain) (
tree)
|
|
/* NSC -- new Scala compiler
* Copyright 2005-2007 LAMP/EPFL
* @author Martin Odersky
*/
// $Id$
package scala.tools.nsc
trait EvalLoop {
def prompt: String
def loop(action: (String) => Unit) {
Console.print(prompt)
val line = Console.readLine
if ((line ne null) && line.length() > 0) {
action(line)
loop(action)
}
}
}
|