There are no “constructors” or “copy constructors” in Lisp in the same sense as in C ++.
Classes in Lisp are instantiated by a make instance and passed by reference. This means that copying does not occur.
As for your question, you can create a function that creates an instance of the class and passes the necessary arguments to the make-instance function or otherwise initializes the instance.
In your case, the easiest way is to have this function:
(defun vecr (&optional (x 0.0) (y 0.0) (z 0.0)) (vector xyz))
source share