If I understood you correctly, you want to take a Common Lisp code as an Elisp string,
eval it within SLIME and obtain the output as an Elisp string plus side-effects.
You can do this with this setup code:
(require 'slime)
(defun lispy--eval-lisp (str)
"Eval STR as Common Lisp code."
(unless (slime-current-connection)
(let ((wnd (current-window-configuration)))
(slime)
(while (not (and (slime-current-connection)
(get-buffer-window (slime-output-buffer))))
(sit-for 0.2))
(set-window-configuration wnd)))
(let (deactivate-mark)
(cadr (slime-eval `(swank:eval-and-grab-output ,str)))))
or alternatively just (require 'le-lisp)
if you have installed lispy
package from MELPA or
github.
Here's a sample usage in *scratch*
:
(lispy--eval-lisp "(load \"~/quicklisp/setup\")")
;; "T"
(lispy--eval-lisp "(ql:quickload 'png)")
;; "(PNG)"
(lispy--eval-lisp "(png:make-image 5 5 1)")
;; "#3A(((0) (0) (0) (0) (0))
;; ((0) (0) (0) (0) (0))
;; ((0) (0) (0) (0) (0))
;; ((0) (0) (0) (0) (0))
;; ((0) (0) (0) (0) (0)))"