[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DEFSTRUCT copier query
- To: Pavel.pa@Xerox.COM
- Subject: Re: DEFSTRUCT copier query
- From: Danny Bobrow <Bobrow.pa@Xerox.COM>
- Date: Mon, 03 Nov 1986 22:13:00 -0000
- Cc: RAM@C.CS.CMU.EDU, samalone@ATHENA.MIT.EDU, common-lisp@SU-AI.ARPA
- In-reply-to: Pavel.pa's message of 3 Nov 86 11:57 PST
- Sender: Bobrow.pa@Xerox.COM
Date: Mon, 3 Nov 86 10:54 EST From: Rob MacLachlan
<RAM@C.CS.CMU.EDU>
Date: Monday, 3 November 1986 10:17-EST From:
<samalone at ATHENA.MIT.EDU>
(copy-bread (make-rye-bread :state 'stale :seeded-p
nil))
A: #S(RYE-BREAD :STATE STALE :SEEDED-P
NIL) or
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.
Pavel
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.
-- danny