Skip to content

Instantly share code, notes, and snippets.

@zkat
Last active August 30, 2015 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zkat/112527 to your computer and use it in GitHub Desktop.
Save zkat/112527 to your computer and use it in GitHub Desktop.
(setq current-cl-package "COMMON-LISP-USER")
(defun erc-cmd-CLPACKAGE (&optional package &rest ignore)
(when package
(setq current-cl-package (upcase package)))
(erc-send-message (format "CL Package is: %s" current-cl-package)))
(defun erc-cmd-EVAL (&rest form)
"Eval FORM and send the result and the original form as:
FORM => (eval FORM)."
(let* ((form-string (mapconcat 'identity form " "))
(result
(condition-case error
(cadr (slime-eval `(swank:eval-and-grab-output ,form-string)
current-cl-package))
(error
(format "Error: %s" error)))))
(erc-send-message (format "%s => %s" form-string result))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment