scala コード (私は SBT を使用しています) を実行すると、次のようにテキストを入力するとプロンプトが表示されます。
C:\... > sbt run
[info] Loading project definition [...]
[info] Set current project to [...]
Running com[...]
test
>>
exit
>> >> >> >> >> >> [success] Total time[...]
print()ステートメントを積み重ねて、別のコマンドを実行したときにのみ表示しているようです。
println()を使用すると、正常に動作します (ただし、改行は必要ありません)。
コード:
...
def main(args:Array[String]) {
var endSession:Boolean = false
var cmd = ""
def acceptInput:Any = {
print(">> ")
cmd = Console.readLine
if (cmd != "exit") {
if (cmd != "") runCommand(cmd)
acceptInput
}
}
acceptInput
}
...
何が起きてる?