Lisp HUG Maillist Archive

subclassing defstruct with defclass?

Dear list,

I had code working fine in LW 6 that was like:

	(defstruct foo a b c)

	(defclass bar (foo) (x y z))


Lispworks 7 does not like this, and says that FOO is an invalid superclass of BAR.
Can someone help me understand what is wrong with it?
I thought structures were valid CLOS classes...


All the best,
Cam


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: subclassing defstruct with defclass?

Hi,

ANSI CL doesn’t give any guarantees that this should work, so in general, you should assume that it doesn’t. (Same for define-condition.)

Pascal

On 12 Dec 2016, at 11:35, Camille Troillard <camille.troillard@icloud.com> wrote:

Dear list,

I had code working fine in LW 6 that was like:

(defstruct foo a b c)

(defclass bar (foo) (x y z))


Lispworks 7 does not like this, and says that FOO is an invalid superclass of BAR.
Can someone help me understand what is wrong with it?
I thought structures were valid CLOS classes...


All the best,
Cam


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

--
Pascal Costanza
The views expressed in this email are my own, and not those of my employer.



Intel Corporation NV/SA
Kings Square, Veldkant 31
2550 Kontich
RPM (Bruxelles) 0415.497.718.
Citibank, Brussels, account 570/1031255/09

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

Re: subclassing defstruct with defclass?

Thank you Pascal,

It's great to see LW is more strict.




On 12 Dec 2016, at 13:06, Costanza, Pascal <pascal.costanza@intel.com> wrote:

Hi,

ANSI CL doesn’t give any guarantees that this should work, so in general, you should assume that it doesn’t. (Same for define-condition.)

Pascal

On 12 Dec 2016, at 11:35, Camille Troillard <camille.troillard@icloud.com> wrote:

Dear list,

I had code working fine in LW 6 that was like:

(defstruct foo a b c)

(defclass bar (foo) (x y z))


Lispworks 7 does not like this, and says that FOO is an invalid superclass of BAR.
Can someone help me understand what is wrong with it?
I thought structures were valid CLOS classes...


All the best,
Cam

Re: subclassing defstruct with defclass?

LispWorks has always been strict about this AFAIK.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/


>>>>> On Mon, 12 Dec 2016 13:47:05 +0100, Camille Troillard said:
> 
> Thank you Pascal,
> 
> It's great to see LW is more strict.
> 
> 
> 
> 
> > On 12 Dec 2016, at 13:06, Costanza, Pascal <pascal.costanza@intel.com> wrote:
> > 
> > Hi,
> > 
> > ANSI CL doesn’t give any guarantees that this should work, so in general, you should assume that it doesn’t. (Same for define-condition.)
> > 
> > Pascal
> > 
> >> On 12 Dec 2016, at 11:35, Camille Troillard <camille.troillard@icloud.com <mailto:camille.troillard@icloud.com>> wrote:
> >> 
> >> Dear list,
> >> 
> >> I had code working fine in LW 6 that was like:
> >> 
> >> (defstruct foo a b c)
> >> 
> >> (defclass bar (foo) (x y z))
> >> 
> >> 
> >> Lispworks 7 does not like this, and says that FOO is an invalid superclass of BAR.
> >> Can someone help me understand what is wrong with it?
> >> I thought structures were valid CLOS classes...
> >> 
> >> 
> >> All the best,
> >> Cam
> 
> 

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Updated at: 2020-12-10 08:31 UTC