define-condition missing :default-initargs pass thru

Ben Hyde <[email protected]> Wed, 18 Sep 2002 07:46:21 -0400 (EDT)
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
Define-condition, which rewrites into defclass, takes and hands off
:default-initargs. Attached below is a diff against 0.13 that implements
that.  I note that there is an MCL release notes imply this was fixed in
the digitool branch, presumably after OpenMCL forked.  Those release
notes could probably be scanned for other stuff to engage idle hands. 
  - ben

% diff -u /tmp/macros.lisp macros.lisp 
--- /tmp/macros.lisp    Tue Jun 11 20:01:21 2002 
+++ macros.lisp Wed Sep 18 06:51:28 2002 
@@ -1829,18 +1829,28 @@ 
   (let ((classopts nil) 
         (duplicate nil) 
         (docp nil) 
+        (default-initargs-p nil) 
         (reporter nil)) 
     (dolist (option options) 
       (unless (and (consp option) 
-                   (consp (%cdr option)) 
-                   (null (%cddr option))) 
+                   (consp (%cdr option))) 
         (error "Invalid option ~s ." option)) 
       (ecase (%car option) 
+       (:default-initargs 
+         (unless (plistp (cdr option)) 
+          (signal-program-error "~S is not a plist." (%cdr option))) 
+        (if default-initargs-p 
+            (setq duplicate t) 
+          (push (setq default-initargs-p option) classopts))) 
         (:documentation  
+        (unless (null (%cddr option)) 
+          (error "Invalid option ~s ." option)) 
          (if docp 
            (setq duplicate t) 
            (push (setq docp option) classopts))) 
         (:report  
+        (unless (null (%cddr option)) 
+          (error "Invalid option ~s ." option)) 
          (if reporter 
            (setq duplicate t) 
            (progn