Created
November 30, 2015 01:18
-
-
Save kimitoboku/6aa26dacc52a0505d819 to your computer and use it in GitHub Desktop.
list try catch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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