Every once in a while, when I move code from ACL to CMUCL, I'm bitten by
structure type mismatches. As I understand it, ACL turns structure
references into indexes into an array of structure elements. As long as
struct A element 1 has the same type as struct B element 1, you can call
the right accessor for the wrong structure, and it all works out.
Case in point:
CL-USER(15): (defstruct m1
id
name)
M1
CL-USER(16): (defstruct m2
id
name
date)
M2
CL-USER(17): (setf *m1* (make-m1 :id 'hi :name "m1-itude"))
#S(M1 :ID HI :NAME "m1-itude")
CL-USER(18): (setf *m2* (make-m2 :id 'bye :name "m2itude" :date
(get-universal-time)))
#S(M2 :ID BYE :NAME "m2itude" :DATE 3220992127)
CL-USER(19): (m1-id *m1*)
HI
CL-USER(20): (m1-id *m2*)
BYE
CL-USER(21): (m2-id *m1*)
HI
CL-USER(22): (m2-id *m2*)
BYE
Safety was turned up to 3, as was debugging, but nothing in this is
compiled.
No errors were generated in the making of this example, but I want errors
here. Is there a way for me to get that?
Thanks,
Michael
--
Michael Hannemann