diff options
| author | Juanma Barranquero | 2007-09-26 00:05:27 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-09-26 00:05:27 +0000 |
| commit | e80155aa0a7ebfe262d960712e7e2115a46c5a89 (patch) | |
| tree | 9190d67b1ebea23a2f5f66b37dba5befcaf84e56 | |
| parent | 7a12ad59360075db1d1257d72f57eb05b5f04d83 (diff) | |
| download | emacs-e80155aa0a7ebfe262d960712e7e2115a46c5a89.tar.gz emacs-e80155aa0a7ebfe262d960712e7e2115a46c5a89.zip | |
(calc-init-extensions, calc-reset): Use `mapc' rather than `mapcar'.
| -rw-r--r-- | lisp/calc/calc-ext.el | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index ab8f743eb34..0aa053702b8 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el | |||
| @@ -618,15 +618,15 @@ | |||
| 618 | 618 | ||
| 619 | (calc-init-prefixes) | 619 | (calc-init-prefixes) |
| 620 | 620 | ||
| 621 | (mapcar (function | 621 | (mapc (function |
| 622 | (lambda (x) | 622 | (lambda (x) |
| 623 | (define-key calc-mode-map (format "c%c" x) 'calc-clean-num) | 623 | (define-key calc-mode-map (format "c%c" x) 'calc-clean-num) |
| 624 | (define-key calc-mode-map (format "j%c" x) 'calc-select-part) | 624 | (define-key calc-mode-map (format "j%c" x) 'calc-select-part) |
| 625 | (define-key calc-mode-map (format "r%c" x) 'calc-recall-quick) | 625 | (define-key calc-mode-map (format "r%c" x) 'calc-recall-quick) |
| 626 | (define-key calc-mode-map (format "s%c" x) 'calc-store-quick) | 626 | (define-key calc-mode-map (format "s%c" x) 'calc-store-quick) |
| 627 | (define-key calc-mode-map (format "t%c" x) 'calc-store-into-quick) | 627 | (define-key calc-mode-map (format "t%c" x) 'calc-store-into-quick) |
| 628 | (define-key calc-mode-map (format "u%c" x) 'calc-quick-units))) | 628 | (define-key calc-mode-map (format "u%c" x) 'calc-quick-units))) |
| 629 | "0123456789") | 629 | "0123456789") |
| 630 | 630 | ||
| 631 | (let ((i ?A)) | 631 | (let ((i ?A)) |
| 632 | (while (<= i ?z) | 632 | (while (<= i ?z) |
| @@ -635,7 +635,7 @@ | |||
| 635 | (cons 'keymap (cons (cons ?\e (aref (nth 1 calc-mode-map) i)) | 635 | (cons 'keymap (cons (cons ?\e (aref (nth 1 calc-mode-map) i)) |
| 636 | (cdr (aref (nth 1 calc-mode-map) i)))))) | 636 | (cdr (aref (nth 1 calc-mode-map) i)))))) |
| 637 | (setq i (1+ i)))) | 637 | (setq i (1+ i)))) |
| 638 | 638 | ||
| 639 | (setq calc-alg-map (copy-keymap calc-mode-map) | 639 | (setq calc-alg-map (copy-keymap calc-mode-map) |
| 640 | calc-alg-esc-map (copy-keymap esc-map)) | 640 | calc-alg-esc-map (copy-keymap esc-map)) |
| 641 | (let ((i 32)) | 641 | (let ((i 32)) |
| @@ -651,7 +651,7 @@ | |||
| 651 | (define-key calc-alg-map "\e\177" 'calc-pop-above) | 651 | (define-key calc-alg-map "\e\177" 'calc-pop-above) |
| 652 | 652 | ||
| 653 | ;;;; (Autoloads here) | 653 | ;;;; (Autoloads here) |
| 654 | (mapcar (function (lambda (x) | 654 | (mapc (function (lambda (x) |
| 655 | (mapcar (function (lambda (func) | 655 | (mapcar (function (lambda (func) |
| 656 | (autoload func (car x)))) (cdr x)))) | 656 | (autoload func (car x)))) (cdr x)))) |
| 657 | '( | 657 | '( |
| @@ -1021,7 +1021,7 @@ calc-arctan calc-arctan2 calc-arctanh calc-conj calc-cos calc-cosh | |||
| 1021 | calc-cot calc-coth calc-csc calc-csch | 1021 | calc-cot calc-coth calc-csc calc-csch |
| 1022 | calc-degrees-mode calc-exp calc-expm1 calc-hypot calc-ilog | 1022 | calc-degrees-mode calc-exp calc-expm1 calc-hypot calc-ilog |
| 1023 | calc-imaginary calc-isqrt calc-ln calc-lnp1 calc-log calc-log10 | 1023 | calc-imaginary calc-isqrt calc-ln calc-lnp1 calc-log calc-log10 |
| 1024 | calc-pi calc-radians-mode calc-sec calc-sech | 1024 | calc-pi calc-radians-mode calc-sec calc-sech |
| 1025 | calc-sin calc-sincos calc-sinh calc-sqrt | 1025 | calc-sin calc-sincos calc-sinh calc-sqrt |
| 1026 | calc-tan calc-tanh calc-to-degrees calc-to-radians) | 1026 | calc-tan calc-tanh calc-to-degrees calc-to-radians) |
| 1027 | 1027 | ||
| @@ -1277,7 +1277,7 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 1277 | calc-redo-list nil) | 1277 | calc-redo-list nil) |
| 1278 | (let (calc-stack calc-user-parse-tables calc-standard-date-formats | 1278 | (let (calc-stack calc-user-parse-tables calc-standard-date-formats |
| 1279 | calc-invocation-macro) | 1279 | calc-invocation-macro) |
| 1280 | (mapcar (function (lambda (v) (set v nil))) calc-local-var-list) | 1280 | (mapc (function (lambda (v) (set v nil))) calc-local-var-list) |
| 1281 | (if (and arg (<= arg 0)) | 1281 | (if (and arg (<= arg 0)) |
| 1282 | (calc-mode-var-list-restore-default-values) | 1282 | (calc-mode-var-list-restore-default-values) |
| 1283 | (calc-mode-var-list-restore-saved-values))) | 1283 | (calc-mode-var-list-restore-saved-values))) |
| @@ -1357,7 +1357,7 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 1357 | (with-current-buffer calc-main-buffer | 1357 | (with-current-buffer calc-main-buffer |
| 1358 | calc-hyperbolic-flag) | 1358 | calc-hyperbolic-flag) |
| 1359 | calc-hyperbolic-flag)) | 1359 | calc-hyperbolic-flag)) |
| 1360 | (msg (if hyp-flag | 1360 | (msg (if hyp-flag |
| 1361 | "Inverse Hyperbolic..." | 1361 | "Inverse Hyperbolic..." |
| 1362 | "Inverse..."))) | 1362 | "Inverse..."))) |
| 1363 | (calc-fancy-prefix 'calc-inverse-flag msg n))) | 1363 | (calc-fancy-prefix 'calc-inverse-flag msg n))) |
| @@ -1438,7 +1438,7 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 1438 | (with-current-buffer calc-main-buffer | 1438 | (with-current-buffer calc-main-buffer |
| 1439 | calc-inverse-flag) | 1439 | calc-inverse-flag) |
| 1440 | calc-inverse-flag)) | 1440 | calc-inverse-flag)) |
| 1441 | (msg (if inv-flag | 1441 | (msg (if inv-flag |
| 1442 | "Inverse Hyperbolic..." | 1442 | "Inverse Hyperbolic..." |
| 1443 | "Hyperbolic..."))) | 1443 | "Hyperbolic..."))) |
| 1444 | (calc-fancy-prefix 'calc-hyperbolic-flag msg n))) | 1444 | (calc-fancy-prefix 'calc-hyperbolic-flag msg n))) |
| @@ -1849,7 +1849,7 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 1849 | (setq calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "") | 1849 | (setq calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "") |
| 1850 | desc)) | 1850 | desc)) |
| 1851 | (if (> (+ (length calc-z-prefix-buf) (length desc)) 58) | 1851 | (if (> (+ (length calc-z-prefix-buf) (length desc)) 58) |
| 1852 | (setq calc-z-prefix-msgs | 1852 | (setq calc-z-prefix-msgs |
| 1853 | (cons calc-z-prefix-buf calc-z-prefix-msgs) | 1853 | (cons calc-z-prefix-buf calc-z-prefix-msgs) |
| 1854 | calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "") | 1854 | calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "") |
| 1855 | desc)) | 1855 | desc)) |
| @@ -1879,14 +1879,14 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 1879 | (last-val (intern (concat (symbol-name name) "-last")))) | 1879 | (last-val (intern (concat (symbol-name name) "-last")))) |
| 1880 | (list 'progn | 1880 | (list 'progn |
| 1881 | ; (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100)) | 1881 | ; (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100)) |
| 1882 | (list 'defvar cache-prec | 1882 | (list 'defvar cache-prec |
| 1883 | `(cond | 1883 | `(cond |
| 1884 | ((consp ,init) (math-numdigs (nth 1 ,init))) | 1884 | ((consp ,init) (math-numdigs (nth 1 ,init))) |
| 1885 | (,init | 1885 | (,init |
| 1886 | (nth 1 (math-numdigs (eval ,init)))) | 1886 | (nth 1 (math-numdigs (eval ,init)))) |
| 1887 | (t | 1887 | (t |
| 1888 | -100))) | 1888 | -100))) |
| 1889 | (list 'defvar cache-val | 1889 | (list 'defvar cache-val |
| 1890 | `(cond | 1890 | `(cond |
| 1891 | ((consp ,init) ,init) | 1891 | ((consp ,init) ,init) |
| 1892 | (,init (eval ,init)) | 1892 | (,init (eval ,init)) |
| @@ -1963,7 +1963,7 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 1963 | (defconst math-approx-sqrt-e | 1963 | (defconst math-approx-sqrt-e |
| 1964 | (math-read-number-simple "1.648721270700128146849") | 1964 | (math-read-number-simple "1.648721270700128146849") |
| 1965 | "An approximation for sqrt(3).") | 1965 | "An approximation for sqrt(3).") |
| 1966 | 1966 | ||
| 1967 | (math-defcache math-sqrt-e math-approx-sqrt-e | 1967 | (math-defcache math-sqrt-e math-approx-sqrt-e |
| 1968 | (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1)))) | 1968 | (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1)))) |
| 1969 | 1969 | ||
| @@ -1975,11 +1975,11 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 1975 | '(float 5 -1))) | 1975 | '(float 5 -1))) |
| 1976 | 1976 | ||
| 1977 | (defconst math-approx-gamma-const | 1977 | (defconst math-approx-gamma-const |
| 1978 | (math-read-number-simple | 1978 | (math-read-number-simple |
| 1979 | "0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495") | 1979 | "0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495") |
| 1980 | "An approximation for gamma.") | 1980 | "An approximation for gamma.") |
| 1981 | 1981 | ||
| 1982 | (math-defcache math-gamma-const nil | 1982 | (math-defcache math-gamma-const nil |
| 1983 | math-approx-gamma-const) | 1983 | math-approx-gamma-const) |
| 1984 | 1984 | ||
| 1985 | (defun math-half-circle (symb) | 1985 | (defun math-half-circle (symb) |
| @@ -2148,12 +2148,12 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 2148 | (unless a | 2148 | (unless a |
| 2149 | (setq a 1)) | 2149 | (setq a 1)) |
| 2150 | (and | 2150 | (and |
| 2151 | (not (memq nil (mapcar | 2151 | (not (memq nil (mapcar |
| 2152 | (lambda (x) (eq x 0)) | 2152 | (lambda (x) (eq x 0)) |
| 2153 | (nthcdr (1+ n) row)))) | 2153 | (nthcdr (1+ n) row)))) |
| 2154 | (not (memq nil (mapcar | 2154 | (not (memq nil (mapcar |
| 2155 | (lambda (x) (eq x 0)) | 2155 | (lambda (x) (eq x 0)) |
| 2156 | (butlast | 2156 | (butlast |
| 2157 | (cdr row) | 2157 | (cdr row) |
| 2158 | (- (length row) n))))) | 2158 | (- (length row) n))))) |
| 2159 | (eq (elt row n) a))) | 2159 | (eq (elt row n) a))) |
| @@ -2218,7 +2218,7 @@ If X is not an error form, return X." | |||
| 2218 | (if (eq (car-safe x) 'sdev) | 2218 | (if (eq (car-safe x) 'sdev) |
| 2219 | (nth 1 x) | 2219 | (nth 1 x) |
| 2220 | x)) | 2220 | x)) |
| 2221 | 2221 | ||
| 2222 | (defun math-get-sdev (x &optional one) | 2222 | (defun math-get-sdev (x &optional one) |
| 2223 | "Get the standard deviation of the error form X. | 2223 | "Get the standard deviation of the error form X. |
| 2224 | If X is not an error form, return 1." | 2224 | If X is not an error form, return 1." |
| @@ -2331,15 +2331,15 @@ If X is not an error form, return 1." | |||
| 2331 | (and (symbolp (car math-normalize-a)) | 2331 | (and (symbolp (car math-normalize-a)) |
| 2332 | (or (eq calc-simplify-mode 'none) | 2332 | (or (eq calc-simplify-mode 'none) |
| 2333 | (and (eq calc-simplify-mode 'num) | 2333 | (and (eq calc-simplify-mode 'num) |
| 2334 | (let ((aptr (setq math-normalize-a | 2334 | (let ((aptr (setq math-normalize-a |
| 2335 | (cons | 2335 | (cons |
| 2336 | (car math-normalize-a) | 2336 | (car math-normalize-a) |
| 2337 | (mapcar 'math-normalize | 2337 | (mapcar 'math-normalize |
| 2338 | (cdr math-normalize-a)))))) | 2338 | (cdr math-normalize-a)))))) |
| 2339 | (while (and aptr (math-constp (car aptr))) | 2339 | (while (and aptr (math-constp (car aptr))) |
| 2340 | (setq aptr (cdr aptr))) | 2340 | (setq aptr (cdr aptr))) |
| 2341 | aptr))) | 2341 | aptr))) |
| 2342 | (cons (car math-normalize-a) | 2342 | (cons (car math-normalize-a) |
| 2343 | (mapcar 'math-normalize (cdr math-normalize-a)))))) | 2343 | (mapcar 'math-normalize (cdr math-normalize-a)))))) |
| 2344 | 2344 | ||
| 2345 | 2345 | ||
| @@ -2720,8 +2720,8 @@ If X is not an error form, return 1." | |||
| 2720 | (setq mmt-nextval (funcall math-mt-func mmt-expr)) | 2720 | (setq mmt-nextval (funcall math-mt-func mmt-expr)) |
| 2721 | (not (equal mmt-expr mmt-nextval))) | 2721 | (not (equal mmt-expr mmt-nextval))) |
| 2722 | (setq mmt-expr mmt-nextval | 2722 | (setq mmt-expr mmt-nextval |
| 2723 | math-mt-many (if (> math-mt-many 0) | 2723 | math-mt-many (if (> math-mt-many 0) |
| 2724 | (1- math-mt-many) | 2724 | (1- math-mt-many) |
| 2725 | (1+ math-mt-many)))) | 2725 | (1+ math-mt-many)))) |
| 2726 | (if (or (Math-primp mmt-expr) | 2726 | (if (or (Math-primp mmt-expr) |
| 2727 | (<= math-mt-many 0)) | 2727 | (<= math-mt-many 0)) |
| @@ -3046,10 +3046,10 @@ If X is not an error form, return 1." | |||
| 3046 | math-read-big-baseline math-read-big-h2 | 3046 | math-read-big-baseline math-read-big-h2 |
| 3047 | new-pos p) | 3047 | new-pos p) |
| 3048 | (while (setq new-pos (string-match "\n" str pos)) | 3048 | (while (setq new-pos (string-match "\n" str pos)) |
| 3049 | (setq math-read-big-lines | 3049 | (setq math-read-big-lines |
| 3050 | (cons (substring str pos new-pos) math-read-big-lines) | 3050 | (cons (substring str pos new-pos) math-read-big-lines) |
| 3051 | pos (1+ new-pos))) | 3051 | pos (1+ new-pos))) |
| 3052 | (setq math-read-big-lines | 3052 | (setq math-read-big-lines |
| 3053 | (nreverse (cons (substring str pos) math-read-big-lines)) | 3053 | (nreverse (cons (substring str pos) math-read-big-lines)) |
| 3054 | p math-read-big-lines) | 3054 | p math-read-big-lines) |
| 3055 | (while p | 3055 | (while p |