chiark / gitweb /
Changed the way initargs are handled when merging slot options
[clg] / glib / gobject.lisp
index 10def18662f78603f2088e9d8b8d34dc09c6ffb0..0014b4d97ebbed1c233fa692fefcc29b6f86998a 100644 (file)
@@ -15,7 +15,7 @@
 ;; License along with this library; if not, write to the Free Software
 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-;; $Id: gobject.lisp,v 1.32 2005-02-10 00:20:02 espen Exp $
+;; $Id: gobject.lisp,v 1.33 2005-02-27 15:14:38 espen Exp $
 
 (in-package "GLIB")
 
@@ -390,12 +390,15 @@ (defun slot-definition-from-property (class property &optional slot-name args)
            '(:construct t))
        
        ;; initargs
-       ,@(when (or (member :construct flags)
-                   (member :construct-only flags)
-                   (member :writable flags))
-           (list :initarg (intern (string slot-name) "KEYWORD")))
-       ,@(cond
-          ((find :initarg args) (list :initarg (getf args :initarg))))
+       ,@(if (find :initarg args)
+             (let ((initarg (getf args :initarg)))
+               (etypecase initarg
+                 (null ())
+                 (symbol `(:initarg ,initarg))))
+           (when (or (member :construct flags)
+                     (member :construct-only flags)
+                     (member :writable flags))
+             (list :initarg (intern (string slot-name) "KEYWORD"))))
        
        :type ,slot-type
        :documentation ,documentation))))