Skip to content

Instantly share code, notes, and snippets.

@bowbow99
Created December 21, 2010 13:30
Show Gist options
  • Select an option

  • Save bowbow99/749930 to your computer and use it in GitHub Desktop.

Select an option

Save bowbow99/749930 to your computer and use it in GitHub Desktop.
undefined-function が投げられたらファイルを load してやり直す
;; load するファイル
(format t "loading: fred.lisp~%")
(defun fred () :fred)
;; 念のため
(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