[Openmcl-devel] Applying sequence functions to a new type
gb at clozure.com
Tue Mar 1 07:52:41 EST 2005
On Mon, 28 Feb 2005, Andrew P. Lentvorski, Jr. wrote:
> This is probably a really stupid question, but how do I define the
> sequence functions so that they apply to a new class?
You basically can't reliably subclass BUILT-IN-CLASSes like SEQUENCE
(or FLOAT or FIXNUM) in CLOS.
The standard sequence functions are not necessarily GENERIC-FUNCTIONs
(they aren't in OpenMCL or in any other implementation I'm aware of),
so you can't extend their behavior by adding methods on them.
There are object systems (I believe that this is true to a large
degree of SmallTalk) in which there's no concept of a non-extensible
BUILT-IN-CLASS and in which all functions are (conceptually, at least)
something like GENERIC-FUNCTIONs, but CLOS is not such a system.
More information about the Openmcl-devel