conc-name nil + include => bug

Kenny Tilton <[email protected]>
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
Here is a simpler way to get the bug mentioned yesterday:

(in-package :cl-user)

(defstruct (aaa (:conc-name nil))
   xxx)

(defstruct (bbb (:include aaa)
             (:conc-name nil))
   yyy)

#+test
(let ((a (make-aaa :xxx 1)))
     (setf (xxx a) 2))

The last form produces:

;;; An error occurred in function CHECK-STRUCT-TYPE:
;;; Error: The object #S( AAA :XXX 1 ) is not a BBB structure
;;; Entering Corman Lisp debug loop.
;;; Use :C followed by an option to exit. Type :HELP for help.
;;; Restart options:
;;; 1   Abort to top level.

Please note I am only guessing that it is related to conc-name nil. My 
theory is that the last struct encountered gets mutators genned for each 
slot including those inherited (makes sense).

without a conc-name or auto-prefixing with struct-name, multiple defun 
(setf xxx)...)s are being generated, and clealry the last one generated 
is the one that sticks (these are defuns so there can be only one).

The last one generated includes a (check-struct-type...) for the last 
(most specific) struct encountered. So setf's of that struct slot for 
any but the most specific struct will fail there.

reminder: CLisp does exactly the same (tho the /name/ of the checker is 
diff than check-struct-type).

-- 

  kenny tilton
  clinisys, inc
  http://www.tilton-technology.com/
  ---------------------------------------------------------------
"Cells let us walk, talk, think, make love and realize
  the bath water is cold." -- Lorraine Lee Cudmore



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/xaxhjB/hdqFAA/xGHJAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.