Plaster
New
List
Login
common-lisp
default
anonymous
2021.06.29 20:54:17
(defclass webhook (standard-class) ()) (defclass webhook-api-direct (webhook-api-slot c2mop:standard-direct-slot-definition) ()) (defclass webhook-api-effective (webhook-api-slot c2mop:standard-effective-slot-definition) ()) (defmethod c2mop:validate-superclass ((class webhook) (metaclass standard-class)) t) (defmethod c2mop:validate-superclass ((class webhook-api-slot) (metaclass standard-class)) t) (defmethod c2mop:effective-slot-definition-class ((class webhook) &rest initargs) (declare (ignore initargs)) (find-class 'webhook-api-effective)) (defmethod c2mop:direct-slot-definition-class ((class webhook) &rest initargs) (declare (ignore initargs)) (find-class 'webhook-api-direct)) (defmethod c2mop:compute-effective-slot-definition ((class webhook) name dslots) (call-next-method)) (defmethod c2mop:compute-effective-slot-definition :after ((class webhook) name dslots) (mapc #'post-process-slot dslots)) (defmethod post-process-slot ((slot webhook-api-direct)) (with-slots (fn validator expected-args) slot (setf fn `(lambda ,expected-args (declare ,(append (list 'ignorable) expected-args)) ,fn) validator `(lambda ,expected-args (declare ,(append (list 'ignorable) expected-args)) ,validator)))) (defmacro %build-function (args &body body) `(lambda ,args (declare (ignorable ,@args)) (locally ,@body))) (defclass direct-message () ((send-otp :private-key "oogaboog" :validator (= unique-id unique-id) :fn (print username) :expected-args (unique-id username otp))) (:metaclass webhook)) (defmethod execute-validator ((slot webhook-api-slot) &rest args) (with-slots (validator) slot (print validator) (apply validator args)))
Raw
Annotate
Repaste
Edit