Re: asdf restart named in the keyword package
Matthew D.Swank <[email protected]> Mon, 16 Jun 2008 23:40:53 +0000 (UTC)
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
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
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php