home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!portal!apple!cambridge.apple.com!bill@cambridge.apple.com
- From: bill@cambridge.apple.com (Bill St. Clair)
- Newsgroups: comp.lang.lisp.mcl
- Subject: Re: SET method not defined automatically...
- Message-ID: <9208141945.AA23755@cambridge.apple.com>
- Date: 14 Aug 92 20:50:26 GMT
- Sender: info-mcl-request@cambridge.apple.com
- Lines: 43
- Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
- Full-Name: Bill St. Clair
- Original-To: frege@eecs.umich.edu
- Original-Cc: info-mcl
-
- >
- > I meant SETF not SET.
- >
- > In the following file, a customized version of defstruct is defined
- >but when I use it with MCL 2.0 the SETF methods for each of its slots
- >seems not to be defined automatically. This was not the case in MACL 1.3.2.
- >
- > [Code omitted]
-
- Works fine for me. Please send example forms that illustrate the omission
- of the SETF methods.
-
- I have assumed the following definitions for the functions that you did
- not include:
-
- -----------------------------------------------------------------------
-
- (defun string-concatenate (&rest strings)
- (apply 'concatenate 'string strings))
-
- (defun mapc-condcons (function list)
- (let ((res nil))
- (dolist (element list)
- (let ((res-el (funcall function element)))
- (when res-el (push element res))))
- (nreverse res)))
-
- (eval-when (:compile-toplevel :execute)
-
- (defmacro sd-slots (sd) `(%svref ,sd 1))
-
- )
-
- (defun structure-slot-names (structure-type)
- (let ((sd (gethash structure-type ccl::%defstructs%))
- res)
- (unless sd
- (error "There is no structure named ~s" structure-type))
- (dolist (slotd (sd-slots sd))
- (let ((slot-name (car slotd)))
- (when (symbolp slot-name)
- (push slot-name res))))
- (nreverse res)))
-