diff options
author | Stefan Kangas <stefan@marxist.se> | 2020-11-17 02:51:30 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2020-11-17 13:00:27 +0100 |
commit | 030ad21afecdd718ce741cff9666c1913a8211df (patch) | |
tree | ea9ea92b33dfb5a2b1f42fb111dc6be297a72615 /lisp/calc/calccomp.el | |
parent | 0a7ec10ac621c210fbf87e4465cb05e378b79889 (diff) | |
download | emacs-030ad21afecdd718ce741cff9666c1913a8211df.tar.gz emacs-030ad21afecdd718ce741cff9666c1913a8211df.tar.bz2 emacs-030ad21afecdd718ce741cff9666c1913a8211df.zip |
Don't quote lambdas with 'function' in calc/*.el
* 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'.
Diffstat (limited to 'lisp/calc/calccomp.el')
-rw-r--r-- | lisp/calc/calccomp.el | 117 |
1 files changed, 57 insertions, 60 deletions
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index 1f3ae842638..e4f6e989ecf 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -464,14 +464,13 @@ (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)) @@ -482,47 +481,46 @@ (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 @@ -865,16 +863,15 @@ (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))) @@ -923,7 +920,7 @@ ( ?\^? . "\\^?" ))) (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) |