ruricolist / serapeum

Utilities beyond Alexandria
MIT License
428 stars 42 forks source link

Restart utilities? #126

Open mmontone opened 2 years ago

mmontone commented 2 years ago

SWANK implements this, but doesn't export:


(defun call-with-retry-restart (msg thunk)
  (loop (with-simple-restart (retry "~a" msg)
          (return (funcall thunk)))))

(defmacro with-retry-restart ((&key (msg "Retry.")) &body body)
  (check-type msg string)
  `(call-with-retry-restart ,msg (lambda () ,@body)))

Would you be interested in including those utilities in Serapeum? There may be other restart utilities that could be worth including ...

ruricolist commented 2 years ago

Those look promising, I'm interested.