On 27 Apr 2022, at 10:26, Robert Goldman wrote:

> Phoebe Goldman writes (but can't post):
>

>> I'm following the manual: "If the action of performing the operation on a 
>> component has
>> dependencies, you must define a method on component-depends-on."
>
>
> This is wrong; I don't know why the manual says that. You still can define a 
> method on COMPONENT-DEPENDS-ON, but there's no reason to unless you have a 
> really weird operation. Writing your own COMPONENT-DEPENDS-ON methods is 
> error-prone and a pain in the ass, so it's much easier to subclass one of the 
> direction-DEPENDS-ON methods and get a built-in method that does the right 
> thing.

I will fix the manual RN.
>
>> But still I don't get why echo-op depends on itself. I didn't specify it
>> anyway. Or it that the default behaviour for all *-operation classes?
>
>
> Honestly, I have no clue why there's an (ECHO-OP . NIL) pair at the head of 
> the COMPONENT-DEPENDS-ON list for an ECHO-OP. But MAP-DIRECT-DEPENDENCIES 
> ignores it. Shrug.
>
>> "A method for [INPUT-FILES] is often not needed, since ASDF has a pretty
>> clever default input-files mechanism."

>
>
> Again, I don't know why the manual says that. You don't need to define 
> INPUT-FILES methods for built-in operations, but you will need to define them 
> for custom operations that take files as input. Most user-defined operations 
> subclass either COMPILE-OP or LOAD-OP, which already have their INPUT-FILES 
> (and OUTPUT-FILES) methods, but I've had to define INPUT-FILES methods in the 
> past.


I will update that, too. TBH, I'm not sure that this is up-to-date with Fare's 
refactoring that introduced the `additional-input-files` generic function, but 
I don't have enough time today to dig into this burger.

>> Is there a way to obtain the pathname to (:FILE "foo") from the
>> CL-SOURCE-FILE object like what COMPILE-OP does?
>
>
> COMPONENT-PATHNAME.
>
>> Why do I get nothing for my input-files? I'm expecting it to print out
>> the pathname to (:FILE "foo") object, very much like the input files
>> into COMPILE-OP.
>
> Taking the COMPONENT-PATHNAME as the sole INPUT-FILE can't be the default, 
> because lots of operations do something different. If you think of 
> PREPARE-OP, COMPILE-OP and LOAD-OP as being the "normal" operations on a 
> LISP-SOURCE-FILE, only COMPILE-OP takes the source file as an INPUT-FILE. 
> LOAD-OP takes as an INPUT-FILE the compiled fasl, which is the OUTPUT-FILES 
> of COMPILE-OP. I don't think PREPARE-OP takes any INPUT-FILES at all, but I 
> could be wrong.

According to the docs, most operations inherit from `self ward-operation`, 
which would take the component-pathname as an input file (and might take 
others).

If this is wrong, please let me know and I will adjust the documentation.


Getting more of this discussion into the manual would be great, since there's 
lots of good guidance here.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to