Show
Ignore:
Timestamp:
11/18/04 08:05:19 (4 years ago)
Author:
miyoshi
Message:

Sync up.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/emacs-21.3.50/lisp/calc/calc-rewr.el

    r3533 r3551  
    144144   (calc-handle-whys))) 
    145145 
    146 (defun calc-match (pat
    147   (interactive "sPattern: \n") 
     146(defun calc-match (pat &optional interactive
     147  (interactive "sPattern: \np") 
    148148  (calc-slow-wrapper 
    149149   (let (n expr) 
     
    152152               pat (calc-top-n 1) 
    153153               n 2) 
    154        (if (interactive-p) (setq calc-previous-alg-entry pat)) 
     154       (if interactive (setq calc-previous-alg-entry pat)) 
    155155       (setq pat (if (stringp pat) (math-read-expr pat) pat)) 
    156156       (if (eq (car-safe pat) 'error) 
     
    167167 
    168168 
    169 (defun math-rewrite (whole-expr rules &optional mmt-many) 
     169(defun math-rewrite (whole-expr rules &optional math-mt-many) 
    170170  (let ((crules (math-compile-rewrites rules)) 
    171171        (heads (math-rewrite-heads whole-expr)) 
     
    177177        (calc-show-selections t) 
    178178        (calc-why nil) 
    179         (mmt-func (function 
    180                   (lambda (x) 
    181                     (let ((result (math-apply-rewrites x (cdr crules) 
    182                                                        heads crules))) 
    183                       (if result 
    184                           (progn 
    185                             (if trace-buffer 
    186                                 (let ((fmt (math-format-stack-value 
    187                                             (list result nil nil)))) 
    188                                   (save-excursion 
    189                                     (set-buffer trace-buffer) 
    190                                     (insert "\nrewrite to\n" fmt "\n")))) 
    191                             (setq heads (math-rewrite-heads result heads t)))) 
    192                       result))))) 
     179        (math-mt-func (function 
     180                       (lambda (x) 
     181                         (let ((result (math-apply-rewrites x (cdr crules) 
     182                                                            heads crules))) 
     183                           (if result 
     184                               (progn 
     185                                 (if trace-buffer 
     186                                    (let ((fmt (math-format-stack-value 
     187                                                 (list result nil nil)))) 
     188                                       (save-excursion 
     189                                         (set-buffer trace-buffer) 
     190                                         (insert "\nrewrite to\n" fmt "\n")))) 
     191                                 (setq heads (math-rewrite-heads result heads t)))) 
     192                           result))))) 
    193193    (if trace-buffer 
    194194        (let ((fmt (math-format-stack-value (list whole-expr nil nil)))) 
     
    198198            (goto-char (point-max)) 
    199199            (insert "\n\nBegin rewriting\n" fmt "\n")))) 
    200     (or mmt-many (setq mmt-many (or (nth 1 (car crules)) 
     200    (or math-mt-many (setq math-mt-many (or (nth 1 (car crules)) 
    201201                                    math-rewrite-default-iters))) 
    202     (if (equal mmt-many '(var inf var-inf)) (setq mmt-many 1000000)) 
    203     (if (equal mmt-many '(neg (var inf var-inf))) (setq mmt-many -1000000)) 
     202    (if (equal math-mt-many '(var inf var-inf)) (setq math-mt-many 1000000)) 
     203    (if (equal math-mt-many '(neg (var inf var-inf))) (setq math-mt-many -1000000)) 
    204204    (math-rewrite-phase (nth 3 (car crules))) 
    205205    (if trace-buffer 
     
    208208            (set-buffer trace-buffer) 
    209209            (insert "\nDone rewriting" 
    210                     (if (= mmt-many 0) " (reached iteration limit)" "") 
     210                    (if (= math-mt-many 0) " (reached iteration limit)" "") 
    211211                    ":\n" fmt "\n")))) 
    212212    whole-expr)) 
    213213 
    214214(defun math-rewrite-phase (sched) 
    215   (while (and sched (/= mmt-many 0)) 
     215  (while (and sched (/= math-mt-many 0)) 
    216216    (if (listp (car sched)) 
    217217        (while (let ((save-expr whole-expr))