Re: with-slots usage question

"Robert P. Goldman" <[email protected]> Mon, 10 Nov 2003 22:07:46 -0600
Newsgroups gmane.lisp.clump
Message-ID <[email protected]>
>>>>> "Nikodemus" == Nikodemus Siivola <[email protected]> writes:

    Nikodemus> On Mon, Nov 10, 2003 at 02:15:37PM -0600, Robert P. Goldman wrote:
    >> I feel awfully stupid asking this, but....  Can't you just shadow
    >> LENGTH and STRING in your package if you want to override them?

    Nikodemus> "Yes, but I don't want to."

    >> So I can make a generic function for LENGTH that has as its default
    >> method (for type T) COMMON-LISP:LENGTH, and put whatever other methods
    >> I want for it.  Yes?

    Nikodemus> This I had not actually thought of. 

    Nikodemus> I like the idea in essence, but have the feeling that this is asking 
    Nikodemus> for trouble.

    Nikodemus> In the very least, STRING is also a type specifier, so
    Nikodemus> the amount of hair is greater then just shadow +
    Nikodemus> defgeneric. (Applies to VECTOR, ARRAY, etc. as well.)

I think what's funny is that type specifiers function differently from
other symbol bindings.  We have a lot of flexibility to work with the
function and value bindings and move them back and forth (e.g., if I
want a package to inherit the function binding of a symbol, but not
its value binding, I can shadow it, and then assign the
symbol-function of the shadowed symbol to the shadowing one).  But I
don't BELIEVE we can do this with a "type binding."  The spec says:
 "Types are never explicitly represented as objects by Common
 Lisp. Instead, they are referred to indirectly by the use of type
 specifiers, which are objects that denote types."

I believe this means there's no "type binding" we can copy around, so
we'd always have to refer to STRING as COMMON-LISP:STRING if we
shadowed STRING --- we couldn't copy anything to the interned STRING
in our new package.

Is this right?  Anyone know?

Cheers,
R