[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[spr1737] type checking on structure slot access

>> Is there a way to have type checking so that this kind of thing does not
>> happen? 
>> <cl 74> (defstruct struct-a slot)
>> <cl 75> (defstruct struct-b slotb)
>> <cl 77> (struct-b-slotb (make-struct-a :slot 2))
>> 2 

Yes, there is.  You can use the fact that 

	(typep (make-struct-a :slot 2) 'struct-b)

will return NIL to decide whether you want to use the struct-b accessor.

					George Jacob 
					Franz Inc.
					INTERNET: georgej@franz.com
					UUCP:     uunet!franz!georgej