Guest User

Untitled

a guest
Sep 10th, 2023
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.66 KB | None | 0 0
  1. (defun get-signals (obj)
  2.   (declare (optimize (speed 0) (space 0) (debug 3)))
  3.   (remove-if-not
  4.    (lambda (it)
  5.      (let ((instance-type (getf it 'make-instance)))
  6.        (member instance-type '(sl-signal-binary sl-signal-number sl-signal-binary-lambda sl-signal-number-lambda))))
  7.    (mapcar (lambda (it) (concatenate 'list (list :name (first it)) (cadr it)))
  8.        (remove-if-not
  9.         (lambda (it)
  10.           (and
  11.            (listp (cadr it))
  12.            (equalp 'make-instance (caadr it))))
  13.         (mapcar
  14.          (lambda (slot)
  15.            (list
  16.         (c2mop:slot-definition-name slot)
  17.         (c2mop:slot-definition-initform slot)))
  18.          (c2mop:class-slots (find-class (type-of obj))))))))
Add Comment
Please, Sign In to add comment