From: Matthew D. S. <ako...@gm...> - 2008-06-16 23:41:05
|
Christophe Rhodes <csr21 <at> cantab.net> writes: > > Gary King <gwking <at> metabang.com> writes: > > > I'm happy to apply this patch unless the internet says "no". > > Here's one reason why not, though you'll have to use your judgment or > get further discussion. > ... > If try-recompiling is ASDF:TRY-RECOMPILING, that would have to be > written > (handler-bind ((error (lambda (c) (invoke-restart (find-symbol "TRY-RECOMPILING" "ASDF") c)))) > (require :foo)) > if the user is not certain that asdf is already loaded. > Well, the use cases I am thinking about are at the repl where it's easy enough to ensure asdf is loaded. I usually use asdf:oos anyway as I switch lisps a lot. However, if one is doing something fancier I don't think it's much of a hardship to have the more verbose form. I wouldn't use handler-bind in the repl directly anyway: it's too verbose. I had the following, very specific macro in mind when I started down this path: (defmacro punt (system) `(handler-bind ((sb-fasl::invalid-fasl-version (lambda (e) (let ((restart (find-restart :try-recompiling))) (if restart (invoke-restart restart) (signal e)))))) (asdf:oos 'asdf:load-op ,system))) Matt |