Created
July 31, 2012 10:50
-
-
Save rigidus/3216053 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defclass my-metaclass (standard-class) | |
((slot-metaclass :initform nil | |
:initarg :slot-metaclass | |
:accessor slot-metaclass)) | |
(:documentation "metaclass")) | |
(defmethod validate-superclass ((class my-metaclass) (super-class standard-class)) | |
t) | |
(defmethod make-instance ((class direct-my-arg-slot) &rest initargs &key my-arg) | |
(error "123213213")) | |
(defclass direct-my-arg-slot (standard-direct-slot-definition) | |
((my-arg :initarg :my-arg :reader my-arg)) | |
(:documentation "Type of slots expanded my-arg")) | |
(defmethod direct-slot-definition-class ((class my-metaclass) &rest initargs &key my-arg &allow-other-keys) | |
(declare (ignore initargs)) | |
(if my-arg | |
(find-class 'direct-my-arg-slot) | |
(call-next-method))) | |
(defclass my-class () | |
((slot-class :initform nil | |
:my-arg :the-arg | |
:initarg :slot-class | |
:accessor :slot-class)) | |
(:metaclass my-metaclass)) | |
(make-instance 'my-class :slot-class "111") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment