Created
December 21, 2010 13:30
-
-
Save bowbow99/749930 to your computer and use it in GitHub Desktop.
undefined-function が投げられたらファイルを load してやり直す
This file contains hidden or 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
| ;; load するファイル | |
| (format t "loading: fred.lisp~%") | |
| (defun fred () :fred) |
This file contains hidden or 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
| ;; 念のため | |
| (unintern 'fred) | |
| => t | |
| ;; 確認 | |
| (funcall 'fred) | |
| >> 関数が定義されていません: fred | |
| (block try-funcall | |
| (tagbody beginning | |
| (handler-bind ((undefined-function | |
| (lambda (e) | |
| (go load-and-retry)))) | |
| (return-from try-funcall | |
| (funcall 'fred))) | |
| load-and-retry | |
| (load "fred.lisp") | |
| (go beginning))) | |
| loading: fred.lisp | |
| => :fred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment