From: Eliot Handelman
Subject: conc-name in DEFSTRUCT
Date: 
Message-ID: <7564@phoenix.Princeton.EDU>
Ok, Should this or shouldn't it work?

(defstruct (foo (:conc-name common-))
  x
  y)

(defstruct (quux (:conc-name common-))
  x
  y)

It doesn't work in either KCl or Lucid 2.2, because the access functions get
redefined in the second form. Would you like it to work? I would.

Also, can someone tell me what the depth argument to user-defined print
functions for structures is good for? How is it set, for example?

From: Barry Margolin
Subject: Re: conc-name in DEFSTRUCT
Date: 
Message-ID: <38532@think.UUCP>
In article <····@phoenix.Princeton.EDU> ·····@phoenix.Princeton.EDU (Eliot Handelman) writes:
>Ok, Should this or shouldn't it work?
[Defines two different structures with the same (:conc-name common-) and same
slot names.]
>It doesn't work in either KCl or Lucid 2.2, because the access functions get
>redefined in the second form. Would you like it to work? I would.

What should it do?  Either COMMON-X and COMMON-Y take a FOO or a QUUX,
and it is an error to call them with the wrong type of structure.  Be
thankful you're using Lisp implementations that check at all
(Symbolics CL never checks that structure accessors are given the
correct type of structure).

Perhaps you should be using the :include option if you want to allow
one structure's accessors to be used with a similar structure.  Or
maybe you want a real object-oriented programming facility, such as
CLOS.

>Also, can someone tell me what the depth argument to user-defined print
>functions for structures is good for? How is it set, for example?

It's used to implement *PRINT-DEPTH* abbreviation.  If the depth is
larger than *PRINT-DEPTH* you may want to print just a "#", or
abbreviate the format of your output in some other way.

Barry Margolin
Thinking Machines Corp.

······@think.com
{uunet,harvard}!think!barmar
From: Eliot Handelman
Subject: Re: conc-name in DEFSTRUCT
Date: 
Message-ID: <7580@phoenix.Princeton.EDU>
In article <·····@think.UUCP> ······@kulla.think.com.UUCP (Barry Margolin) writes:
>In article <····@phoenix.Princeton.EDU> ·····@phoenix.Princeton.EDU (Eliot Handelman) writes:
>>Ok, Should this or shouldn't it work?
>[Defines two different structures with the same (:conc-name common-) and same
>slot names.]

>What should it do?  Either COMMON-X and COMMON-Y take a FOO or a QUUX,
>and it is an error to call them with the wrong type of structure.  Be
>thankful you're using Lisp implementations that check at all
>(Symbolics CL never checks that structure accessors are given the
>correct type of structure).

Right, I wasn't sure if the accessors were required to do type-checking,
or if there was some way to ovverride that, or whether there should be
some way. 

>Perhaps you should be using the :include option if you want to allow
>one structure's accessors to be used with a similar structure.

:include has one undesirable side effect, though, in that the predicate
of the included structure is true for the second structure. In the 
implementations I'm using TYPE-OF returns the most specific type, but
I don't think that CL guarantees that behaviour. Anyhow :include suits
my purposes.

>Or
>maybe you want a real object-oriented programming facility, such as
>CLOS.

I had PCL going in Lucid on a vax-8700 and it was great, but it's really
too slow in KCl on a microvax II (our departmental machine). If somebody
wants to donate a Symbolics machine to a music department, it would be
put to fairly unusual use. You'll get mentioned in my thesis. You'll get
a tax rebate.

>>Also, can someone tell me what the depth argument to user-defined print
>>functions for structures is good for? How is it set, for example?

>It's used to implement *PRINT-DEPTH* abbreviation.

Thanks for the help.