BAR must have &rest args parameters. If I run BAR with only 2 arguments e.g.:
Code: Select all
(bar 1 2)
Code: Select all
&optional (type 1) (mask 2)
Code: Select all
(bar 1 2)
Code: Select all
(foo 1 2 3 4)
Code: Select all
(defun foo (src1 src2 &optional (type 3) (mask 4))
(test src1 src2 norm-type mask))
(defun bar (&rest args)
(foo (first args) (second args) (third args) (fourth args)))
I figured out what you were saying and , thanks..that worked perfectly. As far as code quality, would you say this is good coding. Seems a bit much and I was wondering if there was a way to trim it down
Code: Select all
;;double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
;;double cv_norm(Mat* src1, int normType, Mat* mask)
(defcfun ("cv_norm" %norm3) :void
(src1 mat)
(norm-type :int)
(mask mat))
;;double norm(InputArray src1, InputArray src2, int normType=NORM_L2, InputArray mask=noArray())
;;double cv_norm4(Mat* src1, Mat* src2, int normType, Mat* mask)
(defcfun ("cv_norm4" %norm4) :void
(src1 mat)
(src2 mat)
(norm-type :int)
(mask mat))
(defun %%norm3 (src1 &optional (norm-type +norm-l2+) (mask (mat)))
(%norm3 src1 norm-type mask))
(defun %%norm4 (src1 src2 &optional (norm-type +norm-l2+) (mask (mat)))
(%norm4 src1 src2 norm-type mask))
(defun norm (&rest args)
(if (eq (type-of (second args)) 'cv-mat)
(apply #'%%norm4 args)
(apply #'%%norm3 args)))