如何在Kotlin REPL中加载文件
根据Kotlin REPL中的如何在Kotlin REPL中加载文件,kotlin,read-eval-print-loop,Kotlin,Read Eval Print Loop,根据Kotlin REPL中的:help,我可以通过load:命令加载文件 >>> :help Available commands: :help show this help :quit exit the interpreter :dump bytecode dump classes to terminal :load <file> load scrip
: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
无论是load:Rational.kt
还是load:Rational.kt
都不起作用。
如何在REPL中加载文件?
我找不到它的示例。请尝试不使用引号:
>>:load Rational.kt
您的回答让我注意到我使用的是load:
而不是:load
。谢谢
>>> load: "Rational.kt";
error: unexpected tokens (use ';' to separate expressions on the same line)
load: "Rational.kt";