【发布时间】:2017-10-08 15:03:18
【问题描述】:
根据 Kotlin REPL 中的:help,我可以通过load: 命令加载文件。
>>> :help
Available commands:
:help show this help
:quit exit the interpreter
:dump bytecode dump classes to terminal
:load <file> load script from specified file
但是像这样加载文件失败了。
Rational.kt 存在当前目录。
>>> load: "Rational.kt";
error: unexpected tokens (use ';' to separate expressions on the same line)
load: "Rational.kt";
load: Rational.kt 和 load: "Rational.kt" 都不起作用。
如何在 REPL 中加载文件?
我找不到它的例子。
【问题讨论】:
标签: kotlin read-eval-print-loop