In these situations, when writing long s-expressions in REPL, I think the best way is to use slime scratch buffer . you can edit it and after that execute with
CJ
There is no problem pressing input inside the buffer, I use a trick, but the capture may be like this:
(defun print-hello () (format t "Hello, world")) ; => PRINT-HELLO
Also another alternative works without the last parent: - (
or, as suggested in a comment by @jkiisky, enter an expression and add s Cj in the middle of the expression
CL-USER> (defun )
source share