Skip to content

Instantly share code, notes, and snippets.

@kimitoboku
Created November 30, 2015 01:18
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 kimitoboku/6aa26dacc52a0505d819 to your computer and use it in GitHub Desktop.
Save kimitoboku/6aa26dacc52a0505d819 to your computer and use it in GitHub Desktop.
list try catch
(defun my-print (x)
(print x)
'nil)
(defun my-try-catch (flag)
(my-print 1)
(catch 'tag
(progn (my-try-throw flag)
(my-print 2)
'finish))
)
(defun my-try-throw (flag)
(cond (flag (throw 'tag 'abort))))
(defun my-try-unwind-protect (flag)
(catch 'tag
(unwind-protect
(progn
(my-try-throw flag)
(my-print 1))
(my-print 2)
(my-print 3))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment