Anywhere a parameter name can appear in the parameter list you can also use an argument qualifier. Thus the general form of a definition is:
(defmath name (param param...
&optional param param...
&rest param)
body)
where each param is either a symbol or a list of the form
(qual param)
The following qualifiers are recognized:
complete'integer'natnum'integer', but the argument must be non-negative.fixnum'integer', but the argument must fit into a native Lisp integer, which on most systems means less than 2^23 in absolute value. The argument is converted into Lisp-integer form if necessary.float'pred'not-pred'For example,
(defmath foo (a (constp (not-matrixp b)) &optional (float c)
&rest (integer d))
body)
expands to
(defun calcFunc-foo (a b &optional c &rest d)
(and (math-matrixp b)
(math-reject-arg b 'not-matrixp))
(or (math-constp b)
(math-reject-arg b 'constp))
(and c (setq c (math-check-float c)))
(setq d (mapcar 'math-check-integer d))
body)
which performs the necessary checks and conversions before executing the body of the function.