<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Jun 22, 2018 at 5:13 PM Robert Goldman <<a href="mailto:rpgoldman@sift.info">rpgoldman@sift.info</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">I have a library that provides <code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">DEF-UNIMPLEMENTED</code> as a macro for defining stub functions. When you compile a file with unimplemented functions, you get a warning of the type <code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">FOO:UNIMPLEMENTED-STUB</code> in my library <code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">FOO</code>.</p>
<p dir="auto">I'd like to put in an asdf system definition a file spec something like this:</p>
<pre style="background-color:#f7f7f7;border-radius:5px 5px 5px 5px;margin-left:15px;margin-right:15px;max-width:90vw;overflow-x:auto;padding:5px" bgcolor="#F7F7F7"><code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0" bgcolor="#F7F7F7">(:file "file-with-stubs"
:method (:around (o c)
(handler-bind ((foo:unimplemented-stub
#'(lambda (c)
(print c)
(muffle-warning c))
(call-next-method)))
</code></pre>
<p dir="auto">but, of course, the package <code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">foo</code> doesn't exist when this is read (although I could put <code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">(asdf:load-system "foo")</code> upstream of the enclosing defsystem).</p>
<p dir="auto">This isn't a case that's nicely consistent with Faré's hack for translating strings or keyword symbols, nor does it seem easy to use <code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">find-symbol</code> for this purpose.</p></div></div></div></blockquote><div>You could still use FIND-SYMBOL:</div><div>(handler-bind ((error (lambda (c) (when (typep c (find-symbol x :foo)))))) (a))</div></div></div>