From: Keith M. Corbett
Subject: [Q] In CL - subclass of PATHNAME?
Date:
Message-ID: <33boab$gp@sundog.tiac.net>
In theory, does CommonLISP support subclassing PATHNAME? Should
implementations permit this?
E.g. for the purpose of defining a class, a subclass of PATHNAME
(an instance of STRUCTURE-CLASS), with custom methods for functions
like NAMESTRING.
CLtL(2) calls pathnames "objects" but the intent of this is not
explained any further.
. Keith M. Corbett . Special Form Software . Ask me about HyView
.. ···@specialform.com .. 53 Farragut Road .. document systems for
... 617.596.7021 ... Swampscott MA 01907 ... HTML and Interleaf
In article <·········@sundog.tiac.net> ···@specialform.com (Keith M. Corbett) writes:
>In theory, does CommonLISP support subclassing PATHNAME? Should
>implementations permit this?
No, CL doesn't specify the metaclass of PATHNAME. It may be a
BUILT-IN-CLASS, in which case subclasses are not permitted.
>E.g. for the purpose of defining a class, a subclass of PATHNAME
>(an instance of STRUCTURE-CLASS), with custom methods for functions
>like NAMESTRING.
Where does it say that PATHNAME is an instance of STRUCTURE-CLASS?
CLtL says, "Each class that corresponds to a predefined Common Lisp
type specifier can be implemented in one of three ways, at the
discretion of the implementation." Implementing pathnames as
structures is one of the options, but not a requirement.
Furthermore, CL doesn't specify that functions like NAMESTRING are
generic, so you can't define methods for them. An implementation may,
at its discretion, implement any standard function as a generic
function, but it's not required to unless the standard specifically
says so.
>CLtL(2) calls pathnames "objects" but the intent of this is not
>explained any further.
Everything in Lisp is an object. They are all instances of a class,
but not all of those classes have the same features. See p.781 for
the differences between the various metaclasses.
--
Barry Margolin ······@netcom.com
From: Keith M. Corbett
Subject: Re: [Q] In CL - subclass of PATHNAME?
Date:
Message-ID: <33ikg0$oqs@sundog.tiac.net>
In article <················@netcom.com>, ······@netcom.com (Barry Margolin) says:
>
>>E.g. for the purpose of defining a class, a subclass of PATHNAME
>>(an instance of STRUCTURE-CLASS), with custom methods for functions
>>like NAMESTRING.
>
>Where does it say that PATHNAME is an instance of STRUCTURE-CLASS?
Oops, my mistake - this is a Franz ACL implementation choice.
>Furthermore, CL doesn't specify that functions like NAMESTRING are
>generic, so you can't define methods for them. An implementation may,
>at its discretion, implement any standard function as a generic
>function, but it's not required to unless the standard specifically
>says so.
That's what I was missing.
>Everything in Lisp is an object. They are all instances of a class,
>but not all of those classes have the same features. See p.781 for
>the differences between the various metaclasses.
I haven't worked much with CLOS. The LM Flavors system was easier to
learn, I think, and the built-in classes were more customizable.
Thanks for the info!
. Keith M. Corbett . Special Form Software . Ask me about HyView
.. ···@specialform.com .. 53 Farragut Road .. document systems for
... 617.596.7021 ... Swampscott MA 01907 ... HTML and Interleaf