handler-case が bug ってる?
lisp/handler.l を読んでたら :no-error なんてものを使えることを知って使ってみたら compile するとおかしくなってしまった。
;;; 再現用関数 * (defun test (x) (handler-case x (:no-error (x) x))) => test ;;; ここまではダイジョブ * (test 3) => 3 * (compile 'test) => test ;;; compile 後はエラー吐く * (test 3) >> 不正な関数です: (nil (((or error reader-error quit) . #<lexical-closure: (anonymous)>)) 3)
;;; 展開形(これはダイジョブ) * (macroexpand '(handler-case 33 (:no-error (x) x))) => (block #1=#:error-return (multiple-value-call #'(lambda (x) x) (block #2=#:normal-return (return-from #1# (handler-case (return-from #2# 33)))))) => 33
本来の動作と吐かれるエラー見るに、compile すると multiple-value-call される関数の代わりに si:*condition-handlers* を渡しちゃってるのかなと思うけど、compile 済みなんで si:closure-body とか見てもよくわからない。
とりあえず :no-error は使わないという消極的な方法で回避しておく。