Skip to content

Instantly share code, notes, and snippets.

@vito
Created November 5, 2010 05:23
Show Gist options
  • Save vito/663682 to your computer and use it in GitHub Desktop.
Save vito/663682 to your computer and use it in GitHub Desktop.
condition comparison (atomo vs. lisp)
test =
{ { res = { error: @foo } with-restarts: { @use-value -> { r | r } }
res .. "?"
} with-restarts: {
@use-value -> { r | r }
}
} bind: {
Error -> { e | restart: @use-value with: [e show .. "!"] }
}
test print
-- output: @foo!?
(defun test ()
(handler-bind
((error #'(lambda (e) (invoke-restart 'use-value (format nil "~A!" e)))))
(restart-case
(format nil "~A?" (restart-case (error "foo") (use-value (v) v)))
(use-value (v) v))))
(format t "~A~%" (test))
; output: foo!?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment