]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't quote lambdas with 'function' in calc/*.el
authorStefan Kangas <stefan@marxist.se>
Tue, 17 Nov 2020 01:51:30 +0000 (02:51 +0100)
committerStefan Kangas <stefan@marxist.se>
Tue, 17 Nov 2020 12:00:27 +0000 (13:00 +0100)
* lisp/calc/calc-aent.el (calc-do-quick-calc)
(calc-do-calc-eval, math-build-parse-table):
* lisp/calc/calc-alg.el (math-polynomial-base):
* lisp/calc/calc-alg.el (math-is-poly-rec):
* lisp/calc/calc-arith.el (calcFunc-scf):
* lisp/calc/calc-arith.el (math-ceiling, math-round):
* lisp/calc/calc-arith.el (math-trunc-fancy, math-floor-fancy):
* lisp/calc/calc-ext.el (calc-init-extensions, calc-reset)
(calc-refresh-top, calc-z-prefix-help, calc-binary-op-fancy)
(calc-unary-op-fancy):
* lisp/calc/calc-forms.el (math-make-mod):
* lisp/calc/calc-frac.el (calcFunc-frac):
* lisp/calc/calc-funcs.el (calcFunc-euler):
* lisp/calc/calc-help.el (calc-full-help):
* lisp/calc/calc-lang.el (c, pascal, fortran, tex, latex, eqn)
(yacas, maxima, giac, math, maple):
* lisp/calc/calc-macs.el (calc-wrapper, calc-slow-wrapper):
* lisp/calc/calc-map.el (calc-get-operator, calcFunc-mapeqr)
(calcFunc-reducea, calcFunc-rreducea, calcFunc-reduced)
(calcFunc-rreduced, calcFunc-outer):
* lisp/calc/calc-misc.el (another-calc, calc-do-handle-whys):
* lisp/calc/calc-mode.el (calc-save-modes):
* lisp/calc/calc-mtx.el (math-col-matrix, math-mul-mat-vec):
* lisp/calc/calc-poly.el (math-sort-terms, math-poly-div-list)
(math-mul-list, math-sort-poly-base-list)
(math-partial-fractions):
* lisp/calc/calc-prog.el (calc-user-define-formula):
* lisp/calc/calc-rewr.el (math-rewrite, math-compile-patterns)
(math-compile-rewrites, math-parse-schedule)
(math-rwcomp-pattern):
* lisp/calc/calc-store.el (calc-var-name-map, calc-let)
(calc-permanent-variable, calc-insert-variables):
* lisp/calc/calc-stuff.el (calc-flush-caches, calcFunc-pclean)
(calcFunc-pfrac):
* lisp/calc/calc-units.el (math-build-units-table)
(math-decompose-units):
* lisp/calc/calc-vec.el (calcFunc-mrow, math-mat-col)
(calcFunc-mcol, math-mat-less-col, math-mimic-ident):
* lisp/calc/calc-yank.el (calc-edit):
* lisp/calc/calc.el
(calc-mode-var-list-restore-default-values)
(calc-mode-var-list-restore-saved-values, calc-mode, calc-quit):
* lisp/calc/calccomp.el (math-compose-expr)
(math-compose-matrix, math-vector-to-string): Don't quote lambdas with
'function'.

24 files changed:
lisp/calc/calc-aent.el
lisp/calc/calc-alg.el
lisp/calc/calc-arith.el
lisp/calc/calc-ext.el
lisp/calc/calc-forms.el
lisp/calc/calc-frac.el
lisp/calc/calc-funcs.el
lisp/calc/calc-help.el
lisp/calc/calc-lang.el
lisp/calc/calc-macs.el
lisp/calc/calc-map.el
lisp/calc/calc-misc.el
lisp/calc/calc-mode.el
lisp/calc/calc-mtx.el
lisp/calc/calc-poly.el
lisp/calc/calc-prog.el
lisp/calc/calc-rewr.el
lisp/calc/calc-store.el
lisp/calc/calc-stuff.el
lisp/calc/calc-units.el
lisp/calc/calc-vec.el
lisp/calc/calc-yank.el
lisp/calc/calc.el
lisp/calc/calccomp.el

index 6c162b55f7bfcf2ae263781a765c3b1ad61e1b71..338f0ea43e094c2d9ad06ac47b4b86a935f604d5 100644 (file)
@@ -76,8 +76,8 @@
            (calc-refresh-evaltos (nth 2 (nth 1 (car alg-exp))))
            (setq alg-exp (list (nth 2 (car alg-exp)))))
          (setq calc-quick-prev-results alg-exp
-               buf (mapconcat (function (lambda (x)
-                                          (math-format-value x 1000)))
+                buf (mapconcat (lambda (x)
+                                 (math-format-value x 1000))
                               alg-exp
                               " ")
                shortbuf buf)
               (calc-language (if (memq calc-language '(nil big))
                                  'flat calc-language))
               (calc-dollar-values (mapcar
-                                   (function
-                                    (lambda (x)
-                                      (if (stringp x)
-                                          (progn
-                                            (setq x (math-read-exprs x))
-                                            (if (eq (car-safe x)
-                                                    'error)
-                                                (throw 'calc-error
-                                                       (calc-eval-error
-                                                        (cdr x)))
-                                              (car x)))
-                                        x)))
+                                    (lambda (x)
+                                      (if (stringp x)
+                                          (progn
+                                            (setq x (math-read-exprs x))
+                                            (if (eq (car-safe x)
+                                                    'error)
+                                                (throw 'calc-error
+                                                       (calc-eval-error
+                                                        (cdr x)))
+                                              (car x)))
+                                        x))
                                    args))
               (calc-dollar-used 0)
               (res (if (stringp str)
@@ -640,10 +639,10 @@ in Calc algebraic input.")
            (math-find-user-tokens (car (car p)))
            (setq p (cdr p)))
          (setq calc-user-tokens (mapconcat 'identity
-                                           (sort (mapcar 'car math-toks)
-                                                 (function (lambda (x y)
-                                                             (> (length x)
-                                                                (length y)))))
+                                            (sort (mapcar #'car math-toks)
+                                                  (lambda (x y)
+                                                    (> (length x)
+                                                       (length y))))
                                            "\\|")
                calc-last-main-parse-table mtab
                calc-last-user-lang-parse-table ltab
index efb68395f7e12c7e45e18ea73fec58a5cff312b1..53ca01d9516185ac2846bdbc46bcdc9adf74941b 100644 (file)
@@ -1785,7 +1785,7 @@ and should return the simplified expression to use (or nil)."
                                  (cons (nth 2 expr) math-poly-neg-powers))))
                   (not (Math-zerop (nth 2 expr)))
                   (let ((p1 (math-is-poly-rec (nth 1 expr) negpow)))
-                    (mapcar (function (lambda (x) (math-div x (nth 2 expr))))
+                     (mapcar (lambda (x) (math-div x (nth 2 expr)))
                             p1))))
             ((and (eq (car expr) 'calcFunc-exp)
                   (equal math-var '(var e var-e)))
@@ -1838,8 +1838,9 @@ and should return the simplified expression to use (or nil)."
 (defun math-polynomial-base (top-expr &optional pred)
   "Find the variable (or sub-expression) which is the base of polynomial expr."
   (let ((math-poly-base-pred
-         (or pred (function (lambda (base) (math-polynomial-p
-                                      top-expr base))))))
+         (or pred (lambda (base)
+                    (math-polynomial-p
+                     top-expr base)))))
   (or (let ((math-poly-base-const-ok nil))
        (math-polynomial-base-rec top-expr))
       (let ((math-poly-base-const-ok t))
index ae397c4f2c42fb7029aa08031ab6570084e3e55a..c11cecfd545c0ed93f1f9f9670a061526695ad04 100644 (file)
                           (math-trunc (nth 3 a)))))
        ((math-provably-integerp a) a)
        ((Math-vectorp a)
-        (math-map-vec (function (lambda (x) (math-trunc x math-trunc-prec))) a))
+         (math-map-vec (lambda (x) (math-trunc x math-trunc-prec)) a))
        ((math-infinitep a)
         (if (or (math-posp a) (math-negp a))
             a
                             (math-add (math-floor (nth 3 a)) -1)
                           (math-floor (nth 3 a)))))
        ((Math-vectorp a)
-        (math-map-vec (function (lambda (x) (math-floor x math-floor-prec))) a))
+         (math-map-vec (lambda (x) (math-floor x math-floor-prec)) a))
        ((math-infinitep a)
         (if (or (math-posp a) (math-negp a))
             a
                           (math-ceiling (nth 2 a)))
                         (math-ceiling (nth 3 a))))
        ((Math-vectorp a)
-        (math-map-vec (function (lambda (x) (math-ceiling x prec))) a))
+         (math-map-vec (lambda (x) (math-ceiling x prec)) a))
        ((math-infinitep a)
         (if (or (math-posp a) (math-negp a))
             a
        ((eq (car a) 'intv)
         (math-floor (math-add a '(frac 1 2))))
        ((Math-vectorp a)
-        (math-map-vec (function (lambda (x) (math-round x prec))) a))
+         (math-map-vec (lambda (x) (math-round x prec)) a))
        ((math-infinitep a)
         (if (or (math-posp a) (math-negp a))
             a
                    (calcFunc-scf (nth 2 x) n)
                    (calcFunc-scf (nth 3 x) n))))
            ((eq (car x) 'vec)
-            (math-map-vec (function (lambda (x) (calcFunc-scf x n))) x))
+             (math-map-vec (lambda (x) (calcFunc-scf x n)) x))
            ((math-infinitep x)
             x)
            (t
index 23248ce1bd57b3c75583032f529e780474ecbb9a..4877fa6e08c7e86a02839183b47d0ee4719e8ee9 100644 (file)
 
   (calc-init-prefixes)
 
-  (mapc (function
-        (lambda (x)
+  (mapc (lambda (x)
          (define-key calc-mode-map (format "c%c" x) 'calc-clean-num)
          (define-key calc-mode-map (format "j%c" x) 'calc-select-part)
          (define-key calc-mode-map (format "r%c" x) 'calc-recall-quick)
          (define-key calc-mode-map (format "s%c" x) 'calc-store-quick)
          (define-key calc-mode-map (format "t%c" x) 'calc-store-into-quick)
-         (define-key calc-mode-map (format "u%c" x) 'calc-quick-units)))
+          (define-key calc-mode-map (format "u%c" x) 'calc-quick-units))
        "0123456789")
 
   (let ((i ?A))
   (define-key calc-alg-map "\e\177" 'calc-pop-above)
 
 ;;;; (Autoloads here)
-  (mapc (function (lambda (x)
-    (mapcar (function (lambda (func) (autoload func (car x))))
-            (cdr x))))
+  (mapc (lambda (x)
+          (mapcar (lambda (func) (autoload func (car x)))
+                  (cdr x)))
     '(
 
  ("calc-alg" calc-has-rules math-defsimplify
@@ -980,9 +979,9 @@ calc-force-refresh calc-locate-cursor-element calc-show-edit-buffer)
 
 ))
 
-  (mapcar (function (lambda (x)
-                      (mapcar (function (lambda (cmd) (autoload cmd (car x) nil t)))
-                              (cdr x))))
+  (mapcar (lambda (x)
+            (mapcar (lambda (cmd) (autoload cmd (car x) nil t))
+                    (cdr x)))
     '(
 
  ("calc-alg" calc-alg-evaluate calc-apart calc-collect calc-expand
@@ -1358,7 +1357,7 @@ calc-kill calc-kill-region calc-yank))))
             calc-redo-list nil)
       (let (calc-stack calc-user-parse-tables calc-standard-date-formats
                        calc-invocation-macro)
-        (mapc (function (lambda (v) (set v nil))) calc-local-var-list)
+        (mapc (lambda (v) (set v nil)) calc-local-var-list)
         (if (and arg (<= arg 0))
             (calc-mode-var-list-restore-default-values)
           (calc-mode-var-list-restore-saved-values)))
@@ -1658,7 +1657,7 @@ calc-kill calc-kill-region calc-yank))))
            (calc-pop-stack n 1 t)
            (calc-push-list (mapcar #'car entries)
                            1
-                           (mapcar (function (lambda (x) (nth 2 x)))
+                            (mapcar (lambda (x) (nth 2 x))
                                    entries)))))))
 
 (defvar calc-refreshing-evaltos nil)
@@ -1924,11 +1923,10 @@ calc-kill calc-kill-region calc-yank))))
   (let* ((calc-z-prefix-msgs nil)
         (calc-z-prefix-buf "")
         (kmap (sort (copy-sequence (calc-user-key-map))
-                    (function (lambda (x y) (< (car x) (car y))))))
+                     (lambda (x y) (< (car x) (car y)))))
         (flags (apply #'logior
-                      (mapcar (function
-                               (lambda (k)
-                                 (calc-user-function-classify (car k))))
+                       (mapcar (lambda (k)
+                                 (calc-user-function-classify (car k)))
                               kmap))))
     (if (= (logand flags 8) 0)
        (calc-user-function-list kmap 7)
@@ -2633,9 +2631,8 @@ If X is not an error form, return 1."
           (let ((rhs (calc-top-n 1)))
             (calc-enter-result (- 1 n)
                                name
-                               (mapcar (function
-                                        (lambda (x)
-                                          (list func x rhs)))
+                                (mapcar (lambda (x)
+                                          (list func x rhs))
                                        (calc-top-list-n (- n) 2))))))))
 
 (defun calc-unary-op-fancy (name func arg)
@@ -2644,9 +2641,8 @@ If X is not an error form, return 1."
     (cond ((> n 0)
           (calc-enter-result n
                              name
-                             (mapcar (function
-                                      (lambda (x)
-                                        (list func x)))
+                              (mapcar (lambda (x)
+                                        (list func x))
                                      (calc-top-list-n n))))
          ((< n 0)
           (calc-enter-result 1
index 465d4520b05982279e1e752484144b087d6a4bba..39116bfde99c8d39a411c608366a1c821c6d693c 100644 (file)
@@ -2129,7 +2129,7 @@ and ends on the last Sunday of October at 2 a.m."
             ((memq (car n) '(+ - / vec neg))
              (math-normalize
               (cons (car n)
-                    (mapcar (function (lambda (x) (math-make-mod x m)))
+                     (mapcar (lambda (x) (math-make-mod x m))
                             (cdr n)))))
             ((and (eq (car n) '*) (Math-anglep (nth 1 n)))
              (math-mul (math-make-mod (nth 1 n) m) (nth 2 n)))
index 86a4808c5ad26a655a14bccc03f2dfab1759b374..1d6895caa3a95318f5de3ad0689fbb796f70d1ce 100644 (file)
   (cond ((Math-ratp a)
         a)
        ((memq (car a) '(cplx polar vec hms date sdev intv mod))
-        (cons (car a) (mapcar (function
-                               (lambda (x)
-                                 (calcFunc-frac x tol)))
+         (cons (car a) (mapcar (lambda (x)
+                                 (calcFunc-frac x tol))
                               (cdr a))))
        ((Math-messy-integerp a)
         (math-trunc a))
index 5c179ff05d4848560ee9e4cdc372ded87a291b28..9ee86e755eab9a3e2271bd79148b170c5f22e25f 100644 (file)
           (math-reduce-vec
            'math-add
            (cons 'vec
-                 (mapcar (function
-                          (lambda (c)
-                            (setq k (1+ k))
-                            (math-mul (math-mul fac c)
-                                      (math-sub (math-pow x1 k)
-                                                (math-pow x2 k)))))
+                  (mapcar (lambda (c)
+                            (setq k (1+ k))
+                            (math-mul (math-mul fac c)
+                                      (math-sub (math-pow x1 k)
+                                                (math-pow x2 k))))
                          coefs)))
           x)))
     (math-mul (math-pow 2 n)
index 0b327e8d0f682a605d615e148cd87d7a44015c84..06b4b9684e30b0af3a27d295ca33ccdf697715a3 100644 (file)
@@ -402,32 +402,32 @@ C-w  Describe how there is no warranty for Calc."
             "Or type `h i' to read the full Calc manual on-line.\n\n"))
     (princ "Basic keys:\n")
     (let* ((calc-full-help-flag t))
-      (mapc (function (lambda (x) (princ (format
-                                          "  %s\n"
-                                          (substitute-command-keys x)))))
+      (mapc (lambda (x)
+              (princ (format
+                      "  %s\n"
+                      (substitute-command-keys x))))
            (nreverse (cdr (reverse (cdr (calc-help))))))
-      (mapc (function (lambda (prefix)
-                       (let ((msgs (ignore-errors (funcall prefix))))
-                         (if (car msgs)
-                             (princ
-                              (if (eq (nth 2 msgs) ?v)
-                                   (format-message
-                                    "\n`v' or `V' prefix (vector/matrix) keys: \n")
-                                (if (nth 2 msgs)
-                                    (format-message
-                                     "\n`%c' prefix (%s) keys:\n"
-                                     (nth 2 msgs)
-                                     (or (cdr (assq (nth 2 msgs)
-                                                    calc-help-long-names))
-                                         (nth 1 msgs)))
-                                  (format "\n%s-modified keys:\n"
-                                          (capitalize (nth 1 msgs)))))))
-                         (mapcar (function
-                                   (lambda (x)
-                                     (princ (format
-                                             "  %s\n"
-                                             (substitute-command-keys x)))))
-                                 (car msgs)))))
+      (mapc (lambda (prefix)
+              (let ((msgs (ignore-errors (funcall prefix))))
+                (if (car msgs)
+                    (princ
+                     (if (eq (nth 2 msgs) ?v)
+                         (format-message
+                          "\n`v' or `V' prefix (vector/matrix) keys: \n")
+                       (if (nth 2 msgs)
+                           (format-message
+                            "\n`%c' prefix (%s) keys:\n"
+                            (nth 2 msgs)
+                            (or (cdr (assq (nth 2 msgs)
+                                           calc-help-long-names))
+                                (nth 1 msgs)))
+                         (format "\n%s-modified keys:\n"
+                                 (capitalize (nth 1 msgs)))))))
+                (mapcar (lambda (x)
+                          (princ (format
+                                  "  %s\n"
+                                  (substitute-command-keys x))))
+                        (car msgs))))
            '(calc-inverse-prefix-help
              calc-hyperbolic-prefix-help
              calc-inv-hyp-prefix-help
index bde5abe649f4dda2c65e3675abf1ad5cd6d47ef7..283069446e018fbb3661e0362060c06182f6808b 100644 (file)
 (put 'c 'math-vector-brackets "{}")
 
 (put 'c 'math-radix-formatter
-     (function (lambda (r s)
-                (if (= r 16) (format "0x%s" s)
-                  (if (= r 8) (format "0%s" s)
-                    (format "%d#%s" r s))))))
+     (lambda (r s)
+       (if (= r 16) (format "0x%s" s)
+         (if (= r 8) (format "0%s" s)
+           (format "%d#%s" r s)))))
 
 (put 'c 'math-compose-subscr
-     (function
-      (lambda (a)
-        (let ((args (cdr (cdr a))))
-          (list 'horiz
-                (math-compose-expr (nth 1 a) 1000)
-                "["
-                (math-compose-vector args ", " 0)
-                "]")))))
+     (lambda (a)
+       (let ((args (cdr (cdr a))))
+         (list 'horiz
+               (math-compose-expr (nth 1 a) 1000)
+               "["
+               (math-compose-vector args ", " 0)
+               "]"))))
 
 (add-to-list 'calc-lang-slash-idiv 'c)
 (add-to-list 'calc-lang-allow-underscores 'c)
 (put 'pascal 'math-output-filter 'calc-output-case-filter)
 
 (put 'pascal 'math-radix-formatter
-     (function (lambda (r s)
-                (if (= r 16) (format "$%s" s)
-                  (format "%d#%s" r s)))))
+     (lambda (r s)
+       (if (= r 16) (format "$%s" s)
+         (format "%d#%s" r s))))
 
 (put 'pascal 'math-lang-read-symbol
      '((?\$
               math-exp-pos (match-end 1)))))
 
 (put 'pascal 'math-compose-subscr
-     (function
-      (lambda (a)
-        (let ((args (cdr (cdr a))))
-          (while (eq (car-safe (nth 1 a)) 'calcFunc-subscr)
-            (setq args (append (cdr (cdr (nth 1 a))) args)
-                  a (nth 1 a)))
-          (list 'horiz
-                (math-compose-expr (nth 1 a) 1000)
-                "["
-                (math-compose-vector args ", " 0)
-                "]")))))
+     (lambda (a)
+       (let ((args (cdr (cdr a))))
+         (while (eq (car-safe (nth 1 a)) 'calcFunc-subscr)
+           (setq args (append (cdr (cdr (nth 1 a))) args)
+                 a (nth 1 a)))
+         (list 'horiz
+               (math-compose-expr (nth 1 a) 1000)
+               "["
+               (math-compose-vector args ", " 0)
+               "]"))))
 
 (add-to-list 'calc-lang-allow-underscores 'pascal)
 (add-to-list 'calc-lang-brackets-are-subscripts 'pascal)
               math-exp-pos (match-end 0)))))
 
 (put 'fortran 'math-compose-subscr
-     (function
-      (lambda (a)
-        (let ((args (cdr (cdr a))))
-          (while (eq (car-safe (nth 1 a)) 'calcFunc-subscr)
-            (setq args (append (cdr (cdr (nth 1 a))) args)
-                  a (nth 1 a)))
-          (list 'horiz
-                (math-compose-expr (nth 1 a) 1000)
-                "("
-                (math-compose-vector args ", " 0)
-                ")")))))
+     (lambda (a)
+       (let ((args (cdr (cdr a))))
+         (while (eq (car-safe (nth 1 a)) 'calcFunc-subscr)
+           (setq args (append (cdr (cdr (nth 1 a))) args)
+                 a (nth 1 a)))
+         (list 'horiz
+               (math-compose-expr (nth 1 a) 1000)
+               "("
+               (math-compose-vector args ", " 0)
+               ")"))))
 
 (add-to-list 'calc-lang-slash-idiv 'fortran)
 (add-to-list 'calc-lang-allow-underscores 'fortran)
 (put 'tex 'math-input-filter 'math-tex-input-filter)
 
 (put 'tex 'math-matrix-formatter
-     (function
-      (lambda (a)
-        (if (and (integerp calc-language-option)
-                 (or (= calc-language-option 0)
-                     (> calc-language-option 1)
-                     (< calc-language-option -1)))
-            (append '(vleft 0 "\\matrix{")
-                    (math-compose-tex-matrix (cdr a))
-                    '("}"))
-          (append '(horiz "\\matrix{ ")
-                  (math-compose-tex-matrix (cdr a))
-                  '(" }"))))))
+     (lambda (a)
+       (if (and (integerp calc-language-option)
+                (or (= calc-language-option 0)
+                    (> calc-language-option 1)
+                    (< calc-language-option -1)))
+           (append '(vleft 0 "\\matrix{")
+                   (math-compose-tex-matrix (cdr a))
+                   '("}"))
+         (append '(horiz "\\matrix{ ")
+                 (math-compose-tex-matrix (cdr a))
+                 '(" }")))))
 
 (put 'tex 'math-var-formatter 'math-compose-tex-var)
 
 (put 'latex 'math-complex-format 'i)
 
 (put 'latex 'math-matrix-formatter
-     (function
-      (lambda (a)
-        (if (and (integerp calc-language-option)
-                 (or (= calc-language-option 0)
-                     (> calc-language-option 1)
-                     (< calc-language-option -1)))
-            (append '(vleft 0 "\\begin{pmatrix}")
-                    (math-compose-tex-matrix (cdr a) t)
-                    '("\\end{pmatrix}"))
-          (append '(horiz "\\begin{pmatrix} ")
-                  (math-compose-tex-matrix (cdr a) t)
-                  '(" \\end{pmatrix}"))))))
+     (lambda (a)
+       (if (and (integerp calc-language-option)
+                (or (= calc-language-option 0)
+                    (> calc-language-option 1)
+                    (< calc-language-option -1)))
+           (append '(vleft 0 "\\begin{pmatrix}")
+                   (math-compose-tex-matrix (cdr a) t)
+                   '("\\end{pmatrix}"))
+         (append '(horiz "\\begin{pmatrix} ")
+                 (math-compose-tex-matrix (cdr a) t)
+                 '(" \\end{pmatrix}")))))
 
 (put 'latex 'math-var-formatter 'math-compose-tex-var)
 
 (put 'eqn 'math-evalto '("evalto " . " -> "))
 
 (put 'eqn 'math-matrix-formatter
-     (function
-      (lambda (a)
-        (append '(horiz "matrix { ")
-                (math-compose-eqn-matrix
-                 (cdr (math-transpose a)))
-                '("}")))))
+     (lambda (a)
+       (append '(horiz "matrix { ")
+               (math-compose-eqn-matrix
+                (cdr (math-transpose a)))
+               '("}"))))
 
 (put 'eqn 'math-var-formatter
-     (function
-      (lambda (a prec)
-        (let (v)
-          (if (and math-compose-hash-args
-                   (let ((p calc-arg-values))
-                     (setq v 1)
-                     (while (and p (not (equal (car p) a)))
-                       (setq p (and (eq math-compose-hash-args t) (cdr p))
-                             v (1+ v)))
-                     p))
-              (if (eq math-compose-hash-args 1)
-                  "#"
-                (format "#%d" v))
-            (if (string-match ".'\\'" (symbol-name (nth 2 a)))
-                (math-compose-expr
-                 (list 'calcFunc-Prime
-                       (list
-                        'var
-                        (intern (substring (symbol-name (nth 1 a)) 0 -1))
-                        (intern (substring (symbol-name (nth 2 a)) 0 -1))))
-                 prec)
-              (symbol-name (nth 1 a))))))))
+     (lambda (a prec)
+       (let (v)
+         (if (and math-compose-hash-args
+                  (let ((p calc-arg-values))
+                    (setq v 1)
+                    (while (and p (not (equal (car p) a)))
+                      (setq p (and (eq math-compose-hash-args t) (cdr p))
+                            v (1+ v)))
+                    p))
+             (if (eq math-compose-hash-args 1)
+                 "#"
+               (format "#%d" v))
+           (if (string-match ".'\\'" (symbol-name (nth 2 a)))
+               (math-compose-expr
+                (list 'calcFunc-Prime
+                      (list
+                       'var
+                       (intern (substring (symbol-name (nth 1 a)) 0 -1))
+                       (intern (substring (symbol-name (nth 2 a)) 0 -1))))
+                prec)
+             (symbol-name (nth 1 a)))))))
 
 (defconst math-eqn-special-funcs
   '( calcFunc-log
      calcFunc-arcsinh calcFunc-arccosh calcFunc-arctanh))
 
 (put 'eqn 'math-func-formatter
-     (function
-      (lambda (func a)
-        (let (left right)
-          (if (string-match "[^']'+\\'" func)
-              (let ((n (- (length func) (match-beginning 0) 1)))
-                (setq func (substring func 0 (- n)))
-                (while (>= (setq n (1- n)) 0)
-                  (setq func (concat func " prime")))))
-          (cond ((or (> (length a) 2)
-                     (not (math-tex-expr-is-flat (nth 1 a))))
-                 (setq left "{left ( "
-                       right " right )}"))
-
-                ((and
-                  (memq (car a) math-eqn-special-funcs)
-                  (= (length a) 2)
-                  (or (Math-realp (nth 1 a))
-                      (memq (car (nth 1 a)) '(var *))))
-                 (setq left "~{" right "}"))
-                (t
-                 (setq left " ( "
-                       right " )")))
-          (list 'horiz func left
-                (math-compose-vector (cdr a) " , " 0)
-                right)))))
+     (lambda (func a)
+       (let (left right)
+         (if (string-match "[^']'+\\'" func)
+             (let ((n (- (length func) (match-beginning 0) 1)))
+               (setq func (substring func 0 (- n)))
+               (while (>= (setq n (1- n)) 0)
+                 (setq func (concat func " prime")))))
+         (cond ((or (> (length a) 2)
+                    (not (math-tex-expr-is-flat (nth 1 a))))
+                (setq left "{left ( "
+                      right " right )}"))
+
+               ((and
+                 (memq (car a) math-eqn-special-funcs)
+                 (= (length a) 2)
+                 (or (Math-realp (nth 1 a))
+                     (memq (car (nth 1 a)) '(var *))))
+                (setq left "~{" right "}"))
+               (t
+                (setq left " ( "
+                      right " )")))
+         (list 'horiz func left
+               (math-compose-vector (cdr a) " , " 0)
+               right))))
 
 (put 'eqn 'math-lang-read-symbol
      '((?\"
      ("above" punc ",")))
 
 (put 'eqn 'math-lang-adjust-words
-     (function
-      (lambda ()
-        (let ((code (assoc math-expr-data math-eqn-ignore-words)))
-          (cond ((null code))
-                ((null (cdr code))
-                 (math-read-token))
-                ((consp (nth 1 code))
-                 (math-read-token)
-                 (if (assoc math-expr-data (cdr code))
-                     (setq math-expr-data (format "%s %s"
-                                                  (car code) math-expr-data))))
-                ((eq (nth 1 code) 'punc)
-                 (setq math-exp-token 'punc
-                       math-expr-data (nth 2 code)))
-                (t
-                 (math-read-token)
-                 (math-read-token)))))))
+     (lambda ()
+       (let ((code (assoc math-expr-data math-eqn-ignore-words)))
+         (cond ((null code))
+               ((null (cdr code))
+                (math-read-token))
+               ((consp (nth 1 code))
+                (math-read-token)
+                (if (assoc math-expr-data (cdr code))
+                    (setq math-expr-data (format "%s %s"
+                                                 (car code) math-expr-data))))
+               ((eq (nth 1 code) 'punc)
+                (setq math-exp-token 'punc
+                      math-expr-data (nth 2 code)))
+               (t
+                (math-read-token)
+                (math-read-token))))))
 
 (put 'eqn 'math-lang-read
      '((eq (string-match "->\\|<-\\|\\+-\\|\\\\dots\\|~\\|\\^"
        ( calcFunc-in    .  (math-lang-compose-switch-args "Contains"))))
 
 (put 'yacas 'math-compose-subscr
-     (function
-      (lambda (a)
-        (let ((args (cdr (cdr a))))
-          (list 'horiz
-                (math-compose-expr (nth 1 a) 1000)
-                "["
-                (math-compose-vector args ", " 0)
-                "]")))))
+     (lambda (a)
+       (let ((args (cdr (cdr a))))
+         (list 'horiz
+               (math-compose-expr (nth 1 a) 1000)
+               "["
+               (math-compose-vector args ", " 0)
+               "]"))))
 
 (defun math-yacas-parse-Sum (f _val)
   "Read in the arguments to \"Sum\" in Calc's Yacas mode."
 (add-to-list 'calc-lang-brackets-are-subscripts 'maxima)
 
 (put 'maxima 'math-compose-subscr
-     (function
-      (lambda (a)
-        (let ((args (cdr (cdr a))))
-          (list 'horiz
-                (math-compose-expr (nth 1 a) 1000)
-                "["
-                (math-compose-vector args ", " 0)
-                "]")))))
+     (lambda (a)
+       (let ((args (cdr (cdr a))))
+         (list 'horiz
+               (math-compose-expr (nth 1 a) 1000)
+               "["
+               (math-compose-vector args ", " 0)
+               "]"))))
 
 (put 'maxima 'math-matrix-formatter
-     (function
-      (lambda (a)
-        (list 'horiz
-              "matrix("
-              (math-compose-vector (cdr a)
-                                   (concat math-comp-comma " ")
-                                   math-comp-vector-prec)
-              ")"))))
+     (lambda (a)
+       (list 'horiz
+             "matrix("
+             (math-compose-vector (cdr a)
+                                  (concat math-comp-comma " ")
+                                  math-comp-vector-prec)
+             ")")))
 
 
 ;;; Giac
@@ -1806,15 +1794,14 @@ order to Calc's."
 (add-to-list 'calc-lang-allow-underscores 'giac)
 
 (put 'giac 'math-compose-subscr
-     (function
-      (lambda (a)
-        ;; (let ((args (cdr (cdr a))))
-          (list 'horiz
-                (math-compose-expr (nth 1 a) 1000)
-                "["
-                (math-compose-expr
-                 (calc-normalize (list '- (nth 2 a) 1)) 0)
-                "]")))) ;;)
+     (lambda (a)
+       ;; (let ((args (cdr (cdr a))))
+       (list 'horiz
+             (math-compose-expr (nth 1 a) 1000)
+             "["
+             (math-compose-expr
+              (calc-normalize (list '- (nth 2 a) 1)) 0)
+             "]"))) ;;)
 
 (defun math-read-giac-subscr (x _op)
   (let ((idx (math-read-expr-level 0)))
@@ -1932,7 +1919,7 @@ order to Calc's."
 (put 'math 'math-function-close "]")
 
 (put 'math 'math-radix-formatter
-     (function (lambda (r s) (format "%d^^%s" r s))))
+     (lambda (r s) (format "%d^^%s" r s)))
 
 (put 'math 'math-lang-read
      '((eq (string-match "\\[\\[\\|->\\|:>" math-exp-str math-exp-pos)
@@ -1942,13 +1929,12 @@ order to Calc's."
              math-exp-pos (match-end 0))))
 
 (put 'math 'math-compose-subscr
-     (function
-      (lambda (a)
-        (list 'horiz
-              (math-compose-expr (nth 1 a) 1000)
-              "[["
-              (math-compose-expr (nth 2 a) 0)
-              "]]"))))
+     (lambda (a)
+       (list 'horiz
+             (math-compose-expr (nth 1 a) 1000)
+             "[["
+             (math-compose-expr (nth 2 a) 0)
+             "]]")))
 
 (defun math-read-math-subscr (x _op)
   (let ((idx (math-read-expr-level 0)))
@@ -2038,26 +2024,24 @@ order to Calc's."
 (put 'maple 'math-complex-format 'I)
 
 (put 'maple 'math-matrix-formatter
-     (function
-      (lambda (a)
-        (list 'horiz
-              "matrix("
-              math-comp-left-bracket
-              (math-compose-vector (cdr a)
-                                   (concat math-comp-comma " ")
-                                   math-comp-vector-prec)
-              math-comp-right-bracket
-              ")"))))
+     (lambda (a)
+       (list 'horiz
+             "matrix("
+             math-comp-left-bracket
+             (math-compose-vector (cdr a)
+                                  (concat math-comp-comma " ")
+                                  math-comp-vector-prec)
+             math-comp-right-bracket
+             ")")))
 
 (put 'maple 'math-compose-subscr
-     (function
-      (lambda (a)
-        (let ((args (cdr (cdr a))))
-          (list 'horiz
-                (math-compose-expr (nth 1 a) 1000)
-                "["
-                (math-compose-vector args ", " 0)
-                "]")))))
+     (lambda (a)
+       (let ((args (cdr (cdr a))))
+         (list 'horiz
+               (math-compose-expr (nth 1 a) 1000)
+               "["
+               (math-compose-vector args ", " 0)
+               "]"))))
 
 (add-to-list 'calc-lang-allow-underscores 'maple)
 (add-to-list 'calc-lang-brackets-are-subscripts 'maple)
index 5aaa5f48d6cf17afca3690a28da14cd945186c02..06ef3ef0556c00ca4305fd629403a6e2b909c778 100644 (file)
 
 
 (defmacro calc-wrapper (&rest body)
-  `(calc-do (function (lambda ()
-                       ,@body))))
+  `(calc-do (lambda ()
+              ,@body)))
 
 (defmacro calc-slow-wrapper (&rest body)
   `(calc-do
-    (function (lambda () ,@body)) (point)))
+    (lambda () ,@body) (point)))
 
 (defmacro math-showing-full-precision (form)
   `(let ((calc-float-format calc-full-float-format))
index 0ee8282692724c83ed9f873205c5a2194cdfb671..3e2869d146a7e6b775cc10c3cdd5d9ad9abccd71 100644 (file)
                                            "()")
                                          minibuffer-local-map
                                          t)))
-                      (setq math-arglist (mapcar (function
-                                             (lambda (x)
-                                               (list 'var
-                                                     x
-                                                     (intern
-                                                      (concat
-                                                       "var-"
-                                                       (symbol-name x))))))
+                       (setq math-arglist (mapcar (lambda (x)
+                                                    (list 'var
+                                                          x
+                                                          (intern
+                                                           (concat
+                                                            "var-"
+                                                            (symbol-name x)))))
                                             math-arglist))))
                 (setq oper (list "$"
                                  (length math-arglist)
     (apply 'calcFunc-mapeqp func args)))
 
 (defun calcFunc-mapeqr (func &rest args)
-  (setq args (mapcar (function (lambda (x)
-                                (let ((func (assq (car-safe x)
-                                                  calc-tweak-eqn-table)))
-                                  (if func
-                                      (cons (nth 1 func) (cdr x))
-                                    x))))
+  (setq args (mapcar (lambda (x)
+                       (let ((func (assq (car-safe x)
+                                         calc-tweak-eqn-table)))
+                         (if func
+                             (cons (nth 1 func) (cdr x))
+                           x)))
                     args))
   (apply 'calcFunc-mapeqp func args))
 
 (defun calcFunc-reducea (func vec)
   (if (math-matrixp vec)
       (cons 'vec
-           (mapcar (function (lambda (x) (calcFunc-reducer func x)))
+            (mapcar (lambda (x) (calcFunc-reducer func x))
                    (cdr vec)))
     (calcFunc-reducer func vec)))
 
 (defun calcFunc-rreducea (func vec)
   (if (math-matrixp vec)
       (cons 'vec
-           (mapcar (function (lambda (x) (calcFunc-rreducer func x)))
+            (mapcar (lambda (x) (calcFunc-rreducer func x))
                    (cdr vec)))
     (calcFunc-rreducer func vec)))
 
 (defun calcFunc-reduced (func vec)
   (if (math-matrixp vec)
       (cons 'vec
-           (mapcar (function (lambda (x) (calcFunc-reducer func x)))
+            (mapcar (lambda (x) (calcFunc-reducer func x))
                    (cdr (math-transpose vec))))
     (calcFunc-reducer func vec)))
 
 (defun calcFunc-rreduced (func vec)
   (if (math-matrixp vec)
       (cons 'vec
-           (mapcar (function (lambda (x) (calcFunc-rreducer func x)))
+            (mapcar (lambda (x) (calcFunc-rreducer func x))
                    (cdr (math-transpose vec))))
     (calcFunc-rreducer func vec)))
 
   (let ((mat nil))
     (while (setq a (cdr a))
       (setq mat (cons (cons 'vec
-                           (mapcar (function (lambda (x)
-                                               (math-build-call func
-                                                                (list (car a)
-                                                                      x))))
+                            (mapcar (lambda (x)
+                                      (math-build-call func
+                                                       (list (car a)
+                                                             x)))
                                    (cdr b)))
                      mat)))
     (math-normalize (cons 'vec (nreverse mat)))))
index 2db09e2b677e5ece08ca187434475c0465a85099..ada754a3979b2b9c53dc5c88960748aa5fc3ff91 100644 (file)
@@ -176,9 +176,9 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
   "Create another, independent Calculator buffer."
   (interactive)
   (if (eq major-mode 'calc-mode)
-      (mapc (function
-            (lambda (v)
-             (set-default v (symbol-value v)))) calc-local-var-list))
+      (mapc (lambda (v)
+              (set-default v (symbol-value v)))
+            calc-local-var-list))
   (set-buffer (generate-new-buffer "*Calculator*"))
   (pop-to-buffer (current-buffer))
   (calc-mode))
@@ -274,9 +274,8 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
 ;;;###autoload
 (defun calc-do-handle-whys ()
   (setq calc-why (sort calc-next-why
-                      (function
-                       (lambda (x y)
-                         (and (eq (car x) '*) (not (eq (car y) '*))))))
+                       (lambda (x y)
+                         (and (eq (car x) '*) (not (eq (car y) '*)))))
        calc-next-why nil)
   (if (and calc-why (or (eq calc-auto-why t)
                        (and (eq (car (car calc-why)) '*)
index e109233a825e1dcfc9f1e765551e1c8ff7650be6..358854bc93c216b52257866d2f365547d6fffde3 100644 (file)
   (interactive)
   (calc-wrapper
    (let (pos
-        (vals (mapcar (function (lambda (v) (symbol-value (car v))))
+         (vals (mapcar (lambda (v) (symbol-value (car v)))
                       calc-mode-var-list)))
      (unless calc-settings-file
        (error "No `calc-settings-file' specified"))
index 8deef7dc4fd5a9a854d309977547c01a2c58654e..bfcd61ddcd4ebebc6a6b816c6395480da71889a3 100644 (file)
@@ -55,7 +55,7 @@
 (defun math-col-matrix (a)
   (if (and (Math-vectorp a)
           (not (math-matrixp a)))
-      (cons 'vec (mapcar (function (lambda (x) (list 'vec x))) (cdr a)))
+      (cons 'vec (mapcar (lambda (x) (list 'vec x)) (cdr a)))
     a))
 
 
@@ -79,8 +79,8 @@
     (cons 'vec (nreverse mat))))
 
 (defun math-mul-mat-vec (a b)
-  (cons 'vec (mapcar (function (lambda (row)
-                                (math-dot-product row b)))
+  (cons 'vec (mapcar (lambda (row)
+                       (math-dot-product row b))
                     (cdr a))))
 
 
index b3f2c96b0cae0fc91a34466f550e2e74bbdf64a0..5928a8ee47c3f0edc3a2a39fdbb963e01ecda10d 100644 (file)
   (if (memq (car-safe expr) '(+ -))
       (math-list-to-sum
        (sort (math-sum-to-list expr)
-            (function (lambda (a b) (math-beforep (car a) (car b))))))
+             (lambda (a b) (math-beforep (car a) (car b)))))
     expr))
 
 (defun math-list-to-sum (lst)
@@ -387,7 +387,7 @@ This returns only the remainder from the pseudo-division."
       lst
     (if (eq a -1)
        (math-mul-list lst a)
-      (mapcar (function (lambda (x) (math-poly-div-exact x a))) lst))))
+      (mapcar (lambda (x) (math-poly-div-exact x a)) lst))))
 
 (defun math-mul-list (lst a)
   (if (eq a 1)
@@ -395,7 +395,7 @@ This returns only the remainder from the pseudo-division."
     (if (eq a -1)
        (mapcar 'math-neg lst)
       (and (not (eq a 0))
-          (mapcar (function (lambda (x) (math-mul x a))) lst)))))
+           (mapcar (lambda (x) (math-mul x a)) lst)))))
 
 ;;; Run GCD on all elements in a list.
 (defun math-poly-gcd-list (lst)
@@ -502,10 +502,10 @@ Take the base that has the highest degree considering both a and b.
 
 (defun math-sort-poly-base-list (lst)
   "Sort a list of polynomial bases."
-  (sort lst (function (lambda (a b)
-                       (or (> (nth 1 a) (nth 1 b))
-                           (and (= (nth 1 a) (nth 1 b))
-                                (math-beforep (car a) (car b))))))))
+  (sort lst (lambda (a b)
+              (or (> (nth 1 a) (nth 1 b))
+                  (and (= (nth 1 a) (nth 1 b))
+                       (math-beforep (car a) (car b)))))))
 
 ;;; Given an expression find all variables that are polynomial bases.
 ;;; Return list in the form '( (var1 degree1) (var2 degree2) ... ).
@@ -1033,10 +1033,9 @@ If no partial fraction representation can be found, return nil."
                                (math-transpose
                                 (cons 'vec
                                       (mapcar
-                                       (function
-                                        (lambda (x)
-                                          (cons 'vec (math-padded-polynomial
-                                                      x var tdeg))))
+                                        (lambda (x)
+                                          (cons 'vec (math-padded-polynomial
+                                                      x var tdeg)))
                                        (cdr eqns))))))
           (and (math-vectorp eqns)
                (let ((res 0)
index ea9c49748e236ce0f2cb913bac7b89c3f7706afd..781ba5c8b669ade2c7509c9921b9492ac2443960 100644 (file)
          odef key keyname cmd cmd-base cmd-base-default
           func calc-user-formula-alist is-symb)
      (if is-lambda
-        (setq math-arglist (mapcar (function (lambda (x) (nth 1 x)))
+         (setq math-arglist (mapcar (lambda (x) (nth 1 x))
                               (nreverse (cdr (reverse (cdr form)))))
               form (nth (1- (length form)) form))
        (calc-default-formula-arglist form)
                        (y-or-n-p
                         "Leave it symbolic for non-constant arguments? ")))
      (setq calc-user-formula-alist
-           (mapcar (function (lambda (x)
-                               (or (cdr (assq x '((nil . arg-nil)
-                                                  (t . arg-t))))
-                                   x))) calc-user-formula-alist))
+           (mapcar (lambda (x)
+                     (or (cdr (assq x '((nil . arg-nil)
+                                        (t . arg-t))))
+                         x)) calc-user-formula-alist))
      (if cmd
         (progn
           (require 'calc-macs)
             (append
              (list 'lambda calc-user-formula-alist)
              (and is-symb
-                  (mapcar (function (lambda (v)
-                                      (list 'math-check-const v t)))
+                   (mapcar (lambda (v)
+                             (list 'math-check-const v t))
                           calc-user-formula-alist))
              (list body))))
      (put func 'calc-user-defn form)
index 2cc7b6beef017e2d6e41a004297d5053ffd3794f..1528e12ae0e3bd5772036798d99b817d14d0a37b 100644 (file)
          (calc-line-numbering nil)
          (calc-show-selections t)
          (calc-why nil)
-         (math-mt-func (function
-                        (lambda (x)
-                          (let ((result (math-apply-rewrites x (cdr crules)
-                                                             heads crules)))
-                            (if result
-                                (progn
-                                  (if trace-buffer
-                                      (let ((fmt (math-format-stack-value
-                                                  (list result nil nil))))
-                                        (with-current-buffer trace-buffer
-                                          (insert "\nrewrite to\n" fmt "\n"))))
-                                  (setq heads (math-rewrite-heads result heads t))))
-                            result)))))
+         (math-mt-func (lambda (x)
+                         (let ((result (math-apply-rewrites x (cdr crules)
+                                                            heads crules)))
+                           (if result
+                               (progn
+                                 (if trace-buffer
+                                     (let ((fmt (math-format-stack-value
+                                                 (list result nil nil))))
+                                       (with-current-buffer trace-buffer
+                                         (insert "\nrewrite to\n" fmt "\n"))))
+                                 (setq heads (math-rewrite-heads result heads t))))
+                           result))))
     (if trace-buffer
        (let ((fmt (math-format-stack-value (list math-rewrite-whole-expr nil nil))))
          (with-current-buffer trace-buffer
     (let ((math-rewrite-whole t))
       (cdr (math-compile-rewrites (cons
                                   'vec
-                                  (mapcar (function (lambda (x)
-                                                      (list 'vec x t)))
+                                   (mapcar (lambda (x)
+                                             (list 'vec x t))
                                           (if (eq (car-safe pats) 'vec)
                                               (cdr pats)
                                             (list pats)))))))))
                                          nil
                                          (nreverse
                                           (mapcar
-                                           (function
-                                            (lambda (v)
-                                              (and (car v)
-                                                   (list
-                                                    'calcFunc-assign
-                                                    (math-build-var-name
-                                                     (car v))
-                                                    (math-rwcomp-register-expr
-                                                     (nth 1 v))))))
+                                            (lambda (v)
+                                              (and (car v)
+                                                   (list
+                                                    'calcFunc-assign
+                                                    (math-build-var-name
+                                                     (car v))
+                                                    (math-rwcomp-register-expr
+                                                     (nth 1 v)))))
                                            math-regs))))
                                 (math-rwcomp-match-vars math-rhs))
                               math-remembering)
            (let* ((heads (math-rewrite-heads math-pattern))
                   (rule (list (vconcat
                                (nreverse
-                                (mapcar (function (lambda (x) (nth 3 x)))
+                                 (mapcar (lambda (x) (nth 3 x))
                                         math-regs)))
                               math-prog
                               heads
        (setq rules (cdr rules)))
       (if nil-rules
          (setq rule-set (cons (cons nil nil-rules) rule-set)))
-      (setq all-heads (mapcar 'car
-                             (sort all-heads (function
-                                              (lambda (x y)
-                                                (< (cdr x) (cdr y)))))))
+      (setq all-heads (mapcar #'car
+                              (sort all-heads (lambda (x y)
+                                                (< (cdr x) (cdr y))))))
       (let ((set rule-set)
            rule heads ptr)
        (while set
              (math-rewrite-heads-rec (car expr)))))))
 
 (defun math-parse-schedule (sched)
-  (mapcar (function
-          (lambda (s)
-            (if (integerp s)
-                s
-              (if (math-vectorp s)
-                  (math-parse-schedule (cdr s))
-                (if (eq (car-safe s) 'var)
-                    (math-var-to-calcFunc s)
-                  (error "Improper component in rewrite schedule"))))))
+  (mapcar (lambda (s)
+            (if (integerp s)
+                s
+              (if (math-vectorp s)
+                  (math-parse-schedule (cdr s))
+                (if (eq (car-safe s) 'var)
+                    (math-var-to-calcFunc s)
+                  (error "Improper component in rewrite schedule")))))
          sched))
 
 (defun math-rwcomp-match-vars (expr)
                                                (list 'calcFunc-register
                                                      reg2))))
                       (math-rwcomp-pattern (car arg2) (cdr arg2))))
-                (let* ((args (mapcar (function
-                                      (lambda (x)
-                                        (cons x (math-rwcomp-best-reg x))))
+                 (let* ((args (mapcar (lambda (x)
+                                        (cons x (math-rwcomp-best-reg x)))
                                      (cdr expr)))
                        (args2 (copy-sequence args))
                        (argp (reverse args2))
index a1e385cb406545c1f4a11a9ed8fec54bf6edcbd3..8f83f34d748fc489cc99616f1427d941b28bb0ef 100644 (file)
     ()
   (setq calc-var-name-map (copy-keymap minibuffer-local-completion-map))
   (define-key calc-var-name-map " " 'self-insert-command)
-  (mapc (function
-        (lambda (x)
+  (mapc (lambda (x)
          (define-key calc-var-name-map (char-to-string x)
-           'calcVar-digit)))
+            'calcVar-digit))
        "0123456789")
-  (mapc (function
-        (lambda (x)
+  (mapc (lambda (x)
          (define-key calc-var-name-map (char-to-string x)
-           'calcVar-oper)))
+            'calcVar-oper))
        "+-*/^|"))
 
 (defvar calc-store-opers)
         (calc-pop-push-record
          (1+ calc-given-value-flag)
          (concat "=" (calc-var-name (car (car var))))
-         (let ((saved-val (mapcar (function
-                                   (lambda (v)
-                                     (and (boundp (car v))
-                                          (symbol-value (car v)))))
+          (let ((saved-val (mapcar (lambda (v)
+                                     (and (boundp (car v))
+                                          (symbol-value (car v))))
                                   var)))
            (unwind-protect
                (let ((vv var))
                                      calc-settings-file)))
      (if var
         (calc-insert-permanent-variable var)
-       (mapatoms (function
-                 (lambda (x)
-                   (and (string-match "\\`var-" (symbol-name x))
-                        (not (memq x calc-dont-insert-variables))
-                        (calc-var-value x)
-                        (not (eq (car-safe (symbol-value x)) 'special-const))
-                        (calc-insert-permanent-variable x))))))
+       (mapatoms (lambda (x)
+                   (and (string-match "\\`var-" (symbol-name x))
+                        (not (memq x calc-dont-insert-variables))
+                        (calc-var-value x)
+                        (not (eq (car-safe (symbol-value x)) 'special-const))
+                        (calc-insert-permanent-variable x)))))
      (save-buffer))))
 
 
 (defun calc-insert-variables (buf)
   (interactive "bBuffer in which to save variable values: ")
   (with-current-buffer buf
-    (mapatoms (function
-              (lambda (x)
-                (and (string-match "\\`var-" (symbol-name x))
-                     (not (memq x calc-dont-insert-variables))
-                     (calc-var-value x)
-                     (not (eq (car-safe (symbol-value x)) 'special-const))
-                     (or (not (eq x 'var-Decls))
-                         (not (equal var-Decls '(vec))))
-                     (or (not (eq x 'var-Holidays))
-                         (not (equal var-Holidays '(vec (var sat var-sat)
-                                                        (var sun var-sun)))))
-                     (insert "(setq "
-                             (symbol-name x)
-                             " "
-                             (prin1-to-string
-                              (let ((calc-language
-                                     (if (memq calc-language '(nil big))
-                                         'flat
-                                       calc-language)))
-                                (math-format-value (symbol-value x) 100000)))
-                             ")\n")))))))
+    (mapatoms (lambda (x)
+                (and (string-match "\\`var-" (symbol-name x))
+                     (not (memq x calc-dont-insert-variables))
+                     (calc-var-value x)
+                     (not (eq (car-safe (symbol-value x)) 'special-const))
+                     (or (not (eq x 'var-Decls))
+                         (not (equal var-Decls '(vec))))
+                     (or (not (eq x 'var-Holidays))
+                         (not (equal var-Holidays '(vec (var sat var-sat)
+                                                        (var sun var-sun)))))
+                     (insert "(setq "
+                             (symbol-name x)
+                             " "
+                             (prin1-to-string
+                              (let ((calc-language
+                                     (if (memq calc-language '(nil big))
+                                         'flat
+                                       calc-language)))
+                                (math-format-value (symbol-value x) 100000)))
+                             ")\n"))))))
 
 (defun calc-assign (arg)
   (interactive "P")
index 58b81faee503e2bd95d4fd0c92c1faa3b983485b..8df2ed905aa436e3ca5bac560ca4f2f8fcff3d57 100644 (file)
@@ -182,7 +182,7 @@ With a prefix, push that prefix as a number onto the stack."
         math-eval-rules-cache-tag t
         math-format-date-cache nil
         math-holidays-cache-tag t)
-   (mapc (function (lambda (x) (set x -100))) math-cache-list)
+   (mapc (lambda (x) (set x -100)) math-cache-list)
    (unless inhibit-msg
      (message "All internal calculator caches have been reset"))))
 
@@ -258,14 +258,14 @@ With a prefix, push that prefix as a number onto the stack."
          (t (list 'calcFunc-clean a)))))
 
 (defun calcFunc-pclean (a &optional prec)
-  (math-map-over-constants (function (lambda (x) (calcFunc-clean x prec)))
+  (math-map-over-constants (lambda (x) (calcFunc-clean x prec))
                           a))
 
 (defun calcFunc-pfloat (a)
   (math-map-over-constants 'math-float a))
 
 (defun calcFunc-pfrac (a &optional tol)
-  (math-map-over-constants (function (lambda (x) (calcFunc-frac x tol)))
+  (math-map-over-constants (lambda (x) (calcFunc-frac x tol))
                           a))
 
 ;; The variable math-moc-func is local to math-map-over-constants,
index 709c09ea099681b737b59be5b9577fb138b3119c..742b2bb8728c58b0a6117d175e4de078a902c1c2 100644 (file)
@@ -860,23 +860,22 @@ If COMP or STD is non-nil, put that in the units table instead."
             tab)
        (message "Building units table...")
        (setq math-units-table-buffer-valid nil)
-       (setq tab (mapcar (function
-                          (lambda (x)
-                            (list (car x)
-                                  (and (nth 1 x)
-                                       (if (stringp (nth 1 x))
-                                           (let ((exp (math-read-plain-expr
-                                                       (nth 1 x))))
-                                             (if (eq (car-safe exp) 'error)
-                                                 (error "Format error in definition of %s in units table: %s"
-                                                        (car x) (nth 2 exp))
-                                               exp))
-                                         (nth 1 x)))
-                                  (nth 2 x)
-                                  (nth 3 x)
-                                  (and (not (nth 1 x))
-                                       (list (cons (car x) 1)))
-                                   (nth 4 x))))
+        (setq tab (mapcar (lambda (x)
+                            (list (car x)
+                                  (and (nth 1 x)
+                                       (if (stringp (nth 1 x))
+                                           (let ((exp (math-read-plain-expr
+                                                       (nth 1 x))))
+                                             (if (eq (car-safe exp) 'error)
+                                                 (error "Format error in definition of %s in units table: %s"
+                                                        (car x) (nth 2 exp))
+                                               exp))
+                                         (nth 1 x)))
+                                  (nth 2 x)
+                                  (nth 3 x)
+                                  (and (not (nth 1 x))
+                                       (list (cons (car x) 1)))
+                                  (nth 4 x)))
                          combined-units))
        (let ((math-units-table tab))
          (mapc #'math-find-base-units tab))
@@ -1100,10 +1099,9 @@ If COMP or STD is non-nil, put that in the units table instead."
               (setq math-decompose-units-cache
                     (cons entry
                           (sort ulist
-                                (function
-                                 (lambda (x y)
-                                   (not (Math-lessp (nth 1 x)
-                                                    (nth 1 y))))))))))
+                                 (lambda (x y)
+                                   (not (Math-lessp (nth 1 x)
+                                                    (nth 1 y)))))))))
         (cdr math-decompose-units-cache))))
 
 (defun math-decompose-unit-part (unit)
index 875414595cfce615913088612f5d65c9f891fd00..036f08e276d7580f8f48c2113409638571b0aeda 100644 (file)
 ;;; Get the Nth row of a matrix.
 (defun calcFunc-mrow (mat n)   ; [Public]
   (if (Math-vectorp n)
-      (math-map-vec (function (lambda (x) (calcFunc-mrow mat x))) n)
+      (math-map-vec (lambda (x) (calcFunc-mrow mat x)) n)
     (if (and (eq (car-safe n) 'intv) (math-constp n))
        (calcFunc-subvec mat
                         (math-add (nth 2 n) (if (memq (nth 1 n) '(2 3)) 0 1))
 
 ;;; Get the Nth column of a matrix.
 (defun math-mat-col (mat n)
-  (cons 'vec (mapcar (function (lambda (x) (elt x n))) (cdr mat))))
+  (cons 'vec (mapcar (lambda (x) (elt x n)) (cdr mat))))
 
 (defun calcFunc-mcol (mat n)   ; [Public]
   (if (Math-vectorp n)
       (calcFunc-trn
-       (math-map-vec (function (lambda (x) (calcFunc-mcol mat x))) n))
+       (math-map-vec (lambda (x) (calcFunc-mcol mat x)) n))
     (if (and (eq (car-safe n) 'intv) (math-constp n))
        (if (math-matrixp mat)
-           (math-map-vec (function (lambda (x) (calcFunc-mrow x n))) mat)
+            (math-map-vec (lambda (x) (calcFunc-mrow x n)) mat)
          (calcFunc-mrow mat n))
       (or (and (integerp (setq n (math-check-integer n)))
               (> n 0))
 
 ;;; Remove the Nth column from a matrix.
 (defun math-mat-less-col (mat n)
-  (cons 'vec (mapcar (function (lambda (x) (math-mat-less-row x n)))
+  (cons 'vec (mapcar (lambda (x) (math-mat-less-row x n))
                     (cdr mat))))
 
 (defun calcFunc-mrcol (mat n)   ; [Public]
       (calcFunc-idn a (1- (length m)))
     (if (math-vectorp m)
        (if (math-zerop a)
-           (cons 'vec (mapcar (function (lambda (x)
-                                          (if (math-vectorp x)
-                                              (math-mimic-ident a x)
-                                            a)))
+            (cons 'vec (mapcar (lambda (x)
+                                 (if (math-vectorp x)
+                                     (math-mimic-ident a x)
+                                   a))
                               (cdr m)))
          (math-dimension-error))
       (calcFunc-idn a))))
index e03c00243c42dbcb82017a6a0d978a0374f9fc74..6186df718dba42f94b044fd91bf55f994ecf0ca9 100644 (file)
@@ -643,12 +643,11 @@ Interactively, reads the register using `register-read-with-preview'."
          (allow-ret (> n 1))
          (list (math-showing-full-precision
                 (mapcar (if (> n 1)
-                            (function (lambda (x)
-                                        (math-format-flat-expr x 0)))
-                          (function
-                           (lambda (x)
-                             (if (math-vectorp x) (setq allow-ret t))
-                             (math-format-nice-expr x (frame-width)))))
+                             (lambda (x)
+                               (math-format-flat-expr x 0))
+                           (lambda (x)
+                             (if (math-vectorp x) (setq allow-ret t))
+                             (math-format-nice-expr x (frame-width))))
                         (if (> n 0)
                             (calc-top-list n)
                           (calc-top-list 1 (- n)))))))
index 5716189b34299ea567f7a64f953f363600486878..9d869f359bce8418e15b572dbebeea6e672ce955 100644 (file)
@@ -506,7 +506,7 @@ The variable VAR will be added to `calc-mode-var-list'."
 
 (defun calc-mode-var-list-restore-default-values ()
   "Restore the default values of the variables in `calc-mode-var-list'."
-  (mapcar (function (lambda (v) (set (car v) (nth 1 v))))
+  (mapcar (lambda (v) (set (car v) (nth 1 v)))
           calc-mode-var-list))
 
 (defun calc-mode-var-list-restore-saved-values ()
@@ -535,7 +535,7 @@ The variable VAR will be added to `calc-mode-var-list'."
                             newvarlist)))
               (setq varlist (cdr varlist)))))))
     (if newvarlist
-        (mapcar (function (lambda (v) (set (car v) (nth 1 v))))
+        (mapcar (lambda (v) (set (car v) (nth 1 v)))
                 newvarlist)
       (calc-mode-var-list-restore-default-values))))
 
@@ -1315,8 +1315,9 @@ Notations:  3.14e6     3.14 * 10^6
 \\{calc-mode-map}
 "
   (interactive)
-  (mapc (function           ;FIXME: Why (set-default v (symbol-value v)) ?!?!?
-        (lambda (v) (set-default v (symbol-value v))))
+  (mapc (lambda (v)
+          ;; FIXME: Why (set-default v (symbol-value v)) ?!?!?
+          (set-default v (symbol-value v)))
         calc-local-var-list)
   (kill-all-local-variables)
   (use-local-map (if (eq calc-algebraic-mode 'total)
@@ -1537,7 +1538,7 @@ See `window-dedicated-p' for what that means."
             (let ((tail (nthcdr (1- calc-undo-length) calc-undo-list)))
               (if tail (setcdr tail nil)))
             (setq calc-redo-list nil))))
-      (mapc (function (lambda (v) (set-default v (symbol-value v))))
+      (mapc (lambda (v) (set-default v (symbol-value v)))
            calc-local-var-list)
       (let ((buf (current-buffer))
             (win (get-buffer-window (current-buffer)))
index 1f3ae842638380d99e17350833a1ce8cee0b0edb..e4f6e989ecf256e974b45d8e55bbe1c4895948c0 100644 (file)
            (math-compose-vector (cdr (nth 1 a))
                                 (math-vector-to-string sep nil)
                                 (or cprec prec))
-         (cons 'horiz (mapcar (function
-                               (lambda (x)
-                                 (if (eq (car-safe x) 'calcFunc-bstring)
-                                     (prog1
-                                         (math-compose-expr
-                                          x (or bprec cprec prec))
-                                       (setq bprec -123))
-                                   (math-compose-expr x (or cprec prec)))))
+          (cons 'horiz (mapcar (lambda (x)
+                                 (if (eq (car-safe x) 'calcFunc-bstring)
+                                     (prog1
+                                         (math-compose-expr
+                                          x (or bprec cprec prec))
+                                       (setq bprec -123))
+                                   (math-compose-expr x (or cprec prec))))
                               (cdr (nth 1 a)))))))
      ((and (memq (car a) '(calcFunc-cvert calcFunc-clvert calcFunc-crvert))
           (not (eq calc-language 'unform))
       (let* ((base 0)
             (v 0)
             (prec (or (nth 2 a) prec))
-            (c (mapcar (function
-                        (lambda (x)
-                          (let ((b nil) (cc nil) a d)
-                            (if (and (memq (car-safe x) '(calcFunc-cbase
-                                                          calcFunc-ctbase
-                                                          calcFunc-cbbase))
-                                     (memq (length x) '(1 2)))
-                                (setq b (car x)
-                                      x (nth 1 x)))
-                            (if (and (eq (car-safe x) 'calcFunc-crule)
-                                     (memq (length x) '(1 2))
-                                     (or (null (nth 1 x))
-                                         (and (math-vectorp (nth 1 x))
-                                              (= (length (nth 1 x)) 2)
-                                              (math-vector-is-string
-                                               (nth 1 x)))
-                                         (and (natnump (nth 1 x))
-                                              (<= (nth 1 x) 255))))
-                                (setq cc (list
-                                          'rule
-                                          (if (math-vectorp (nth 1 x))
-                                              (aref (math-vector-to-string
-                                                     (nth 1 x) nil) 0)
-                                            (or (nth 1 x) ?-))))
-                              (or (and (memq (car-safe x) '(calcFunc-cvspace
-                                                            calcFunc-ctspace
-                                                            calcFunc-cbspace))
-                                       (memq (length x) '(2 3))
-                                       (eq (nth 1 x) 0))
-                                  (null x)
-                                  (setq cc (math-compose-expr x prec))))
-                            (setq a (if cc (math-comp-ascent cc) 0)
-                                  d (if cc (math-comp-descent cc) 0))
-                            (if (eq b 'calcFunc-cbase)
-                                (setq base (+ v a -1))
-                              (if (eq b 'calcFunc-ctbase)
-                                  (setq base v)
-                                (if (eq b 'calcFunc-cbbase)
-                                    (setq base (+ v a d -1)))))
-                            (setq v (+ v a d))
-                            cc)))
+             (c (mapcar (lambda (x)
+                          (let ((b nil) (cc nil) a d)
+                            (if (and (memq (car-safe x) '(calcFunc-cbase
+                                                          calcFunc-ctbase
+                                                          calcFunc-cbbase))
+                                     (memq (length x) '(1 2)))
+                                (setq b (car x)
+                                      x (nth 1 x)))
+                            (if (and (eq (car-safe x) 'calcFunc-crule)
+                                     (memq (length x) '(1 2))
+                                     (or (null (nth 1 x))
+                                         (and (math-vectorp (nth 1 x))
+                                              (= (length (nth 1 x)) 2)
+                                              (math-vector-is-string
+                                               (nth 1 x)))
+                                         (and (natnump (nth 1 x))
+                                              (<= (nth 1 x) 255))))
+                                (setq cc (list
+                                          'rule
+                                          (if (math-vectorp (nth 1 x))
+                                              (aref (math-vector-to-string
+                                                     (nth 1 x) nil) 0)
+                                            (or (nth 1 x) ?-))))
+                              (or (and (memq (car-safe x) '(calcFunc-cvspace
+                                                            calcFunc-ctspace
+                                                            calcFunc-cbspace))
+                                       (memq (length x) '(2 3))
+                                       (eq (nth 1 x) 0))
+                                  (null x)
+                                  (setq cc (math-compose-expr x prec))))
+                            (setq a (if cc (math-comp-ascent cc) 0)
+                                  d (if cc (math-comp-descent cc) 0))
+                            (if (eq b 'calcFunc-cbase)
+                                (setq base (+ v a -1))
+                              (if (eq b 'calcFunc-ctbase)
+                                  (setq base v)
+                                (if (eq b 'calcFunc-cbbase)
+                                    (setq base (+ v a d -1)))))
+                            (setq v (+ v a d))
+                            cc))
                        (cdr (nth 1 a)))))
        (setq c (delq nil c))
        (if c
     (while (<= (setq col (1+ col)) cols)
       (setq res (cons (cons math-comp-just
                            (cons base
-                                 (mapcar (function
-                                          (lambda (r)
-                                            (list 'horiz
-                                                  (math-compose-expr
-                                                   (nth col r)
-                                                   math-comp-vector-prec)
-                                                  (if (= col cols)
-                                                      ""
-                                                    (concat
-                                                      math-comp-comma-spc " ")))))
+                                  (mapcar (lambda (r)
+                                            (list 'horiz
+                                                  (math-compose-expr
+                                                   (nth col r)
+                                                   math-comp-vector-prec)
+                                                  (if (= col cols)
+                                                      ""
+                                                    (concat
+                                                     math-comp-comma-spc " "))))
                                          a)))
                      res)))
     (nreverse res)))
                                         ( ?\^? . "\\^?" )))
 
 (defun math-vector-to-string (a &optional quoted)
-  (setq a (concat (mapcar (function (lambda (x) (if (consp x) (nth 1 x) x)))
+  (setq a (concat (mapcar (lambda (x) (if (consp x) (nth 1 x) x))
                          (cdr a))))
   (if (string-match "[\000-\037\177\\\"]" a)
       (let ((p 0)