I have a note to myself to remove SOURCE-FILE-TYPE from the manual, and I see that it's there just for backwards compatibility.
Am I correct in saying that this should be replaced by COMPONENT-TYPE? That's what the comment says, but then I see this:
(defmethod source-file-type ((component file-component) (system parent-component)) (file-type component)))
which suggests FILE-TYPE, not COMPONENT-TYPE is The Right Thing.
Also, what the heck is the return type of this? I see the following:
(defmethod source-file-type ((component parent-component) (system parent-component)) :directory)
which suggests that it's something like (or string (eql :directory)). Ugh. Shouldn't asking for the file-type of a PARENT-COMPONENT simply be an error?
Sorry to bother you about this: just trying to kill something that's languished on my todo list for more than a year.
cheers, r
On Wed, Jul 8, 2015 at 12:30 PM, Robert Goldman rpgoldman@sift.net wrote:
I have a note to myself to remove SOURCE-FILE-TYPE from the manual, and I see that it's there just for backwards compatibility.
Yes, it's deprecated and should be removed, or moved to a section: "how do I upgrade these deprecated idioms?"
Am I correct in saying that this should be replaced by COMPONENT-TYPE?
I see a remark to that effect under the definition of component-relative-pathname, but that's incorrect. My apologies for not seeing and fixing it earlier.
That's what the comment says, but then I see this:
(defmethod source-file-type ((component file-component) (system parent-component)) (file-type component)))
which suggests FILE-TYPE, not COMPONENT-TYPE is The Right Thing.
Indeed, the accessor you're looking for is FILE-TYPE. Either the component's class defines a default value or an accessor, or the component has to explicitly specify it.
Also, what the heck is the return type of this? I see the following:
(defmethod source-file-type ((component parent-component) (system parent-component)) :directory)
which suggests that it's something like (or string (eql :directory)). Ugh. Shouldn't asking for the file-type of a PARENT-COMPONENT simply be an error?
The correct type should be (or null string (eql :directory))
I believe :directory is how we end up with pathnames for parent components becoming directory pathnames, as in (:module "foo" :pathname "bar" ...) having a relative pathname #p"bar/" on Unix.
Sorry to bother you about this: just trying to kill something that's languished on my todo list for more than a year.
Thank you for addressing these code quality and documentation items!
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org A man of humanity is one who, in seeking to establish himself, finds a foothold for others and who, in desiring attaining himself, helps others to attain. — Confucius (551–479 BC)
which suggests FILE-TYPE, not COMPONENT-TYPE is The Right Thing. Also, what the heck is the return type of this? I see the following:
(defmethod source-file-type ((component parent-component) (system parent-component)) :directory)
which suggests that it's something like (or string (eql :directory)). Ugh. Shouldn't asking for the file-type of a PARENT-COMPONENT simply be an error?
The correct type should be (or null string (eql :directory))
I believe :directory is how we end up with pathnames for parent components becoming directory pathnames, as in (:module "foo" :pathname "bar" ...) having a relative pathname #p"bar/" on Unix.
Also note that NIL doesn't mean "no type" as in (make-pathname :type nil ...), but rather means "don't *add* a type to what the user specifies", as in (parse-unix-namestring foo :type nil) parse-unix-namestring is what handles this :type argument, and also supports :directory. It replaces and generalizes what in latter versions of ASDF 2 (after 2.013) was called COERCE-PATHNAME.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org Democracy is a religion too. It's the worship of jackals by jackasses. — H. L. Mencken