I want to quit swift repl gracefully and not use ctrl-d to exit it.
For eg. python repl can be exited by typing exit(). Is there a similar way of quitting swift repl?
I want to quit swift repl gracefully and not use ctrl-d to exit it.
For eg. python repl can be exited by typing exit(). Is there a similar way of quitting swift repl?
This answer complements Ankit Goel's correct
:quitanswer to also (1) provide an understanding of why the:is needed and (2) other options besides:quit.Swift REPL works in conjuction with the LLDB debugger.
:is a REPL escape prefix to execute an LLDB command. From within REPL,:helpwill list the available LLDB commands.Any of the following will quit both Swift REPL and subsequently LLDB with a single command line.
One can also exit REPL into LLDB with just
:and, then laterquit(orexit) using the LLDB command directly.Addendum: The LLDB command
corcontinuecan be used to return to the Swift REPL environment.