private static ResultPrinter console;
public static void main(String... args) throws Exception {
console = new ResultPrinter(printColors(args));
JavaREPLClient client = clientFor(hostname(args), port(args));
ExpressionReader expressionReader = expressionReaderFor(client);
Option<String> expression = none();
Option<EvaluationResult> result = none();
while (expression.isEmpty() || !result.isEmpty()) {
expression = expressionReader.readExpression();
if (!expression.isEmpty()) {
result = client.execute(expression.get());
if (!result.isEmpty())
console.printEvaluationResult(result.get());
}
}
}