August 23, 2025Aug 23 Hello all,is there a function in Opusmodus similar to this one?Best, Achim(defun x-dx (ls) " Returns the list of the intervals between the consecutive values of a list <ls>. <ls> can also be a list of lists. Examples: (x-dx '(0 340 450 600 500 123)) => (340 110 150 -100 -377) (x-dx '((0 340 450 600 500 123) (30 200 350 500 450 200 600))) => ((340 110 150 -100 -377) (170 150 150 -50 -250 400))" (labels ((x-dx-fun (lst) (loop for i in lst for j in (cdr lst) collect (- j i)))) (if (numberp (first ls)) (x-dx-fun ls) (mapcar #'x-dx-fun ls))))
August 23, 2025Aug 23 (difference '(0 340 450 600 500 123)) (mapcar 'difference '((0 340 450 600 500 123) (30 200 350 500 450 200 600)))
Create an account or sign in to comment