Plaster
New
List
Login
common-lisp
default
anonymous
2023.03.20 08:49:54
(defclass foo () ((name :initarg :name :accessor name :initform nil) (value :initarg :value :accessor value :initform nil) ;; possibly more slots... )) (defun spawn-foo (parent-foo &rest initargs) (let ((default-initargs (list :name (name parent-foo) :value (value parent-foo) ;; possibly more initargs... ))) (apply #'make-instance 'foo (append initargs default-initargs))))
Raw
Annotate
Repaste
Edit