What is wrong with the slot called p in this use of defstruct?
In the final result, the slot for p should hold fred , not
t. The version number of CMU CL and the machine type are given
in the first few lines.
;; Loading #p"/w/mmcconn/init.lisp".
;; Loading #p"/w/mmcconn/lisp/runtimPa.sparcf".
CMU Common Lisp 17f, running on littlewood
Send bug reports and questions to your local CMU CL maintainer, or to
··········@cs.cmu.edu.
Loaded subsystems:
Python 1.0, target SPARCstation/Solaris 2
CLOS based on PCL version: September 16 92 PCL (f)
* (defstruct (mpdq) main d p q pinv qinv rank det-parity)
MPDQ
* (make-mpdq :main 'horse :d 'fish :p 'fred :q 'man)
#S(MPDQ
:MAIN HORSE
:D FISH
:P T
:Q MAN
:PINV NIL
:QINV NIL
:RANK NIL
:DET-PARITY NIL)
*
In article <·············@math.okstate.edu>,
Mark McConnell <·······@math.okstate.edu> wrote:
>What is wrong with the slot called p in this use of defstruct?
>In the final result, the slot for p should hold fred , not
>t. The version number of CMU CL and the machine type are given
>in the first few lines.
By default, DEFSTRUCT automatically creates a predicate <structure-name>-P
that returns T or NIL depending on whether its argument is a structure of
that type. To prevent this, use the (:PREDICATE NIL) defstruct option.
Or use a different name for the slot so that there's no conflict.
--
Barry Margolin
BBN Planet, Cambridge, MA
······@bbnplanet.com - Phone (617) 873-3126 - Fax (617) 873-5508
(BBN customers, please call (800) 632-7638 option 1 for support)