src/middleware/macroexpand.lisp @ 7d0cd39ee703

Don't shit the bed when `load`ing a file with errors

Refactored the evaluator a bit so the file loading middleware can just use the
same evaluation machinery and get all the error handling and stream shuttling
for free.
author Steve Losh <steve@stevelosh.com>
date Sat, 09 Apr 2016 21:45:42 +0000
parents d74fc3dab8fa
children 9d3d9514dbd8
(in-package #:nrepl)

(define-middleware wrap-macroexpand "macroexpand" message
  (let ((form (read-from-string (fset:lookup message "form"))))
    (respond message
             (make-map
               "status" '("done")
               "macroexpand" (format nil "~A" (macroexpand form))
               "macroexpand-1" (format nil "~A" (macroexpand-1 form))))))