emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calc/calc-map.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-map.el [lexbind]
Date: Wed, 08 Dec 2004 19:36:19 -0500

Index: emacs/lisp/calc/calc-map.el
diff -c emacs/lisp/calc/calc-map.el:1.4.4.3 emacs/lisp/calc/calc-map.el:1.4.4.4
*** emacs/lisp/calc/calc-map.el:1.4.4.3 Mon Feb  9 14:14:10 2004
--- emacs/lisp/calc/calc-map.el Wed Dec  8 23:36:21 2004
***************
*** 3,10 ****
  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, 
Inc.
  
  ;; Author: David Gillespie <address@hidden>
! ;; Maintainers: D. Goel <address@hidden>
! ;;              Colin Walters <address@hidden>
  
  ;; This file is part of GNU Emacs.
  
--- 3,9 ----
  ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, 
Inc.
  
  ;; Author: David Gillespie <address@hidden>
! ;; Maintainer: Jay Belanger <address@hidden>
  
  ;; This file is part of GNU Emacs.
  
***************
*** 28,40 ****
  ;;; Code:
  
  ;; This file is autoloaded from calc-ext.el.
- (require 'calc-ext)
  
  (require 'calc-macs)
  
- (defun calc-Need-calc-map () nil)
- 
- 
  (defun calc-apply (&optional oper)
    (interactive)
    (calc-wrapper
--- 27,36 ----
  ;;; Code:
  
  ;; This file is autoloaded from calc-ext.el.
  
+ (require 'calc-ext)
  (require 'calc-macs)
  
  (defun calc-apply (&optional oper)
    (interactive)
    (calc-wrapper
***************
*** 802,826 ****
          (cons f args))))))
  
  ;;; Do substitutions in parallel to avoid crosstalk.
  (defun math-multi-subst (expr olds news)
!   (let ((args nil)
!       temp)
      (while (and olds news)
!       (setq args (cons (cons (car olds) (car news)) args)
            olds (cdr olds)
            news (cdr news)))
      (math-multi-subst-rec expr)))
  
  (defun math-multi-subst-rec (expr)
!   (cond ((setq temp (assoc expr args)) (cdr temp))
        ((Math-primp expr) expr)
        ((and (eq (car expr) 'calcFunc-lambda) (> (length expr) 2))
         (let ((new (list (car expr)))
!              (args args))
           (while (cdr (setq expr (cdr expr)))
             (setq new (cons (car expr) new))
!            (if (assoc (car expr) args)
!                (setq args (cons (cons (car expr) (car expr)) args))))
           (nreverse (cons (math-multi-subst-rec (car expr)) new))))
        (t
         (cons (car expr)
--- 798,831 ----
          (cons f args))))))
  
  ;;; Do substitutions in parallel to avoid crosstalk.
+ 
+ ;; The variables math-ms-temp and math-ms-args are local to 
+ ;; math-multi-subst, but are used by math-multi-subst-rec, which 
+ ;; is called by math-multi-subst.
+ (defvar math-ms-temp)
+ (defvar math-ms-args)
+ 
  (defun math-multi-subst (expr olds news)
!   (let ((math-ms-args nil)
!       math-ms-temp)
      (while (and olds news)
!       (setq math-ms-args (cons (cons (car olds) (car news)) math-ms-args)
            olds (cdr olds)
            news (cdr news)))
      (math-multi-subst-rec expr)))
  
  (defun math-multi-subst-rec (expr)
!   (cond ((setq math-ms-temp (assoc expr math-ms-args)) 
!          (cdr math-ms-temp))
        ((Math-primp expr) expr)
        ((and (eq (car expr) 'calcFunc-lambda) (> (length expr) 2))
         (let ((new (list (car expr)))
!              (math-ms-args math-ms-args))
           (while (cdr (setq expr (cdr expr)))
             (setq new (cons (car expr) new))
!            (if (assoc (car expr) math-ms-args)
!                (setq math-ms-args (cons (cons (car expr) (car expr)) 
!                                           math-ms-args))))
           (nreverse (cons (math-multi-subst-rec (car expr)) new))))
        (t
         (cons (car expr)
***************
*** 1033,1039 ****
                                                  (calcFunc-mod . math-mod)
                                                  (calcFunc-vconcat .
                                                   math-concat) )))
!                                   lfunc)))
                     (while (cdr vec)
                       (setq expr (funcall lfunc expr (nth 1 vec))
                             vec (cdr vec)))))
--- 1038,1044 ----
                                                  (calcFunc-mod . math-mod)
                                                  (calcFunc-vconcat .
                                                   math-concat) )))
!                                   func)))
                     (while (cdr vec)
                       (setq expr (funcall lfunc expr (nth 1 vec))
                             vec (cdr vec)))))
***************
*** 1222,1228 ****
      (math-normalize (cons 'vec (nreverse mat)))))
  
  
! (defun calcFunc-inner (mul-func add-func a b)
    (or (math-vectorp a) (math-reject-arg a 'vectorp))
    (or (math-vectorp b) (math-reject-arg b 'vectorp))
    (if (math-matrixp a)
--- 1227,1239 ----
      (math-normalize (cons 'vec (nreverse mat)))))
  
  
! ;; The variables math-inner-mul-func and math-inner-add-func are
! ;; local to calcFunc-inner, but are used by math-inner-mats,
! ;; which is called by math-inner-mats.
! (defvar math-inner-mul-func)
! (defvar math-inner-add-func)
! 
! (defun calcFunc-inner (math-inner-mul-func math-inner-add-func a b)
    (or (math-vectorp a) (math-reject-arg a 'vectorp))
    (or (math-vectorp b) (math-reject-arg b 'vectorp))
    (if (math-matrixp a)
***************
*** 1240,1246 ****
            (math-dimension-error))))
      (if (math-matrixp b)
        (nth 1 (math-inner-mats (list 'vec a) b))
!       (calcFunc-reduce add-func (calcFunc-map mul-func a b)))))
  
  (defun math-inner-mats (a b)
    (let ((mat nil)
--- 1251,1257 ----
            (math-dimension-error))))
      (if (math-matrixp b)
        (nth 1 (math-inner-mats (list 'vec a) b))
!       (calcFunc-reduce math-inner-add-func (calcFunc-map math-inner-mul-func 
a b)))))
  
  (defun math-inner-mats (a b)
    (let ((mat nil)
***************
*** 1250,1262 ****
        (setq col cols
            row nil)
        (while (> (setq col (1- col)) 0)
!       (setq row (cons (calcFunc-reduce add-func
!                                        (calcFunc-map mul-func
                                                       (car a)
                                                       (math-mat-col b col)))
                        row)))
        (setq mat (cons (cons 'vec row) mat)))
      (cons 'vec (nreverse mat))))
  
  ;;; arch-tag: 980eac49-00e0-4870-b72a-e726b74c7990
  ;;; calc-map.el ends here
--- 1261,1275 ----
        (setq col cols
            row nil)
        (while (> (setq col (1- col)) 0)
!       (setq row (cons (calcFunc-reduce math-inner-add-func
!                                        (calcFunc-map math-inner-mul-func
                                                       (car a)
                                                       (math-mat-col b col)))
                        row)))
        (setq mat (cons (cons 'vec row) mat)))
      (cons 'vec (nreverse mat))))
  
+ (provide 'calc-map)
+ 
  ;;; arch-tag: 980eac49-00e0-4870-b72a-e726b74c7990
  ;;; calc-map.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]