[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DEFSTRUCT copier query
Date: Mon, 3 Nov 86 10:54 EST From: Rob MacLachlan
Date: Monday, 3 November 1986 10:17-EST From:
<samalone at ATHENA.MIT.EDU>
(copy-bread (make-rye-bread :state 'stale :seeded-p
A: #S(RYE-BREAD :STATE STALE :SEEDED-P
B: #S(BREAD :STATE STALE)
Since there doesn't seem to be any support for B, no
one can complain if you implement A, although it may not be
required for Common Lisp.
I can complain, and I would. I am strongly of the opinion that
the function COPY-BREAD here should always create a value of type
BREAD, not one of its subtypes. If you want to get the effect of
A, let us create a new function COPY that copies any Lisp value at
all. It seems strange to have several such functions, one for each
section of the type space. I claim that such a function, along with
COPY-BREAD having semantics B above, would provide all of the
functionality desired in the cleanest way.
Within the new emerging Common Lisp Object Standard, COPY will be
specified as a generic function that copies its argument, producing an
instance of the same type. Functions such as copy-bread would be an
anomaly, but could mean what Pavel suggested.