如何在 Swift REPL 的代码片段中插入换行符

How to insert a newline inside a code snippet in the Swift REPL

我想在 REPL 中已经输入的代码片段前加上一行。屏幕截图显示光标位于应插入 newline 的位置。

我不知道该怎么做,因为点击 return 会尝试 执行 代码段。我还尝试了 CMD-RetAlt-Ret:相同的行为。有什么方法可以在不重新输入整个代码段的情况下做到这一点吗?

Control-V, Control-J 确实起到了作用,类似于在交互式终端中。 Control-V means "the next character should be treated literally" and Control-J 生成换行符。