Function: math-check-for-commas

math-check-for-commas is an autoloaded and byte-compiled function defined in calc-vec.el.gz.

Signature

(math-check-for-commas &optional BALANCING)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-vec.el.gz
(defun math-check-for-commas (&optional balancing)
  (let ((count 0)
	(pos (1- math-exp-pos)))
    (while (and (>= count 0)
		(setq pos (string-match
			   (if balancing "[],[{}()<>]" "[],[{}()]")
			   math-exp-str (1+ pos)))
		(or (/= (aref math-exp-str pos) ?,) (> count 0) balancing))
      (cond ((memq (aref math-exp-str pos) '(?\[ ?\{ ?\( ?\<))
	     (setq count (1+ count)))
	    ((memq (aref math-exp-str pos) '(?\] ?\} ?\) ?\>))
	     (setq count (1- count)))))
    (if balancing
	pos
      (and pos (= (aref math-exp-str pos) ?,)))))