<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 4 Aug 2020, at 17:00, Ilya Perminov wrote:</p>
<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
<p dir="auto">I think there is a problem with the :around method approach - it is<br>
not safe for an ASDF extension to define methods on ASDF's<br>
operations/components, because other ASDF extensions may want to do<br>
the same thing. Imagine there is CFFI* and I want to use both CFFI and<br>
CFFI*.</p>
</blockquote>
<p dir="auto">That is true -- that's why I always try to have either my own operation class or my own component class, or both. So to do this, you would want to have your own subclass of <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">system</code> that you wish to have work this way (e.g., <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">cffi-extended-system</code>) -- you generally do not want to add methods to the standard classes in ASDF, both because of potential collisions, and because you don't know what else they might interfere with.</p>
<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
<p dir="auto">On Tue, Aug 4, 2020 at 2:35 PM Robert Goldman <a href="mailto:rpgoldman@gmail.com" style="color:#777">rpgoldman@gmail.com</a> wrote:</p>
<blockquote style="border-left:2px solid #777; color:#999; margin:0 0 5px; padding-left:5px; border-left-color:#999">
<p dir="auto">On 4 Aug 2020, at 16:18, Ilya Perminov wrote:</p>
<p dir="auto">The around method will look something like this</p>
<p dir="auto">(defmethod input-files :around ((o asdf/bundle::gather-operation) (c system))<br>
(unless (eq (asdf/bundle::bundle-type o) :no-output-file)<br>
(append (call-next-method)<br>
(remove-if-not<br>
(asdf/bundle::pathname-type-equal-function<br>
(asdf/bundle::bundle-pathname-type (asdf/bundle::gather-type o)))<br>
(mappend (lambda (c) (output-files 'process-op c))<br>
(asdf/component:sub-components c :type 'wrapper-file))))))</p>
<p dir="auto">To my taste it knows too much about ASDF guts, but maybe it is not too bad.</p>
<p dir="auto">I'm looking at the code now, and</p>
<p dir="auto">bundle-type is exported from asdf/bundle (but not asdf) (it could use a docstring if you can propose one)</p>
<p dir="auto">So is bundle-pathname-type</p>
<p dir="auto">pathname-type-equal-function is not exported, but it's a trivial combination of pathname-type and equalp</p>
<p dir="auto">gather-type is the only "really internal" function. (A block comment would be nice here, too.)</p>
<p dir="auto">gather-operation is not exported, but I think that's probably wrong on our part: I don't believe there should be hidden operations. If I get around to it, I will probably export it from the asdf (really asdf/interface) package, unless someone has a good argument for it continuing to be internal.</p>
<p dir="auto">So I don't think that is a lot of ASDF internals, especially not for customizing the ASDF protocol.</p>
</blockquote>
</blockquote>
</div>
</div>
</body>
</html>