Function: math-rwcomp-count-refs

math-rwcomp-count-refs is a byte-compiled function defined in calc-rewr.el.gz.

Signature

(math-rwcomp-count-refs VAR)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-rewr.el.gz
(defun math-rwcomp-count-refs (var)
  (let ((count (or (math-expr-contains-count math-pattern var) 0))
	(p math-conds))
    (while p
      (if (eq (car-safe (car p)) 'calcFunc-let)
	  (if (= (length (car p)) 3)
	      (setq count (+ count
			     (or (math-expr-contains-count (nth 2 (car p)) var)
				 0)))
	    (if (and (= (length (car p)) 2)
		     (eq (car-safe (nth 1 (car p))) 'calcFunc-assign)
		     (= (length (nth 1 (car p))) 3))
		(setq count (+ count
			       (or (math-expr-contains-count
				    (nth 2 (nth 1 (car p))) var) 0))))))
      (setq p (cdr p)))
    count))