I use common-lisp for my real-time graphical experiments, and so far this has been wonderful. My speed and usability requirements for cffi compatibility mean that I use typed arrays. One area of ββcode that really seems ugly is the generic versions of my matrix and vector math functions. Since CLOS can not specializes in array length, I am doing something like this:
(defun v+ (vec-a vec-b) (%v+ vec-a vec-b (length a) (length b))) (defmethod %v+ (va vb (la (eql 3)) (lb (eql 3))) ***CODE HERE***)
This works, but does not seem to be correct . I saw extensions for various CL implementations and heard about the promise of SS.
I stepped back from this, as I was afraid that it would break functionality with some CL implementations, but I recently saw a Closer to Mop project.
Key question: Does MOP provide a more efficient length specialization method? Is there any area / methods that I should focus on?
source share