From: Kris K. <kj...@us...> - 2016-06-19 00:51:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via d62d12f499b8305980b9b67973c1003a5a0411f1 (commit) from b9f889a1f81be2ea1fe6fb2af64fced6d8ec9326 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d62d12f499b8305980b9b67973c1003a5a0411f1 Author: Kris Katterjohn <kat...@gm...> Date: Sat Jun 18 19:17:19 2016 -0500 No longer compare characters with EQ The standard doesn't guarantee that characters with the same value are EQ, so compare with EQL instead. In some cases CHAR= could be used (because CHAR= and EQL compare characters in the same way), but in some other cases CHAR= wouldn't work (like when GETCHARN is involved, since it can return NIL instead of a character). This is related to my series of commits regarding the use of EQ for comparing numbers. diff --git a/share/affine/sheafa.lisp b/share/affine/sheafa.lisp index 1754573..359f9a1 100644 --- a/share/affine/sheafa.lisp +++ b/share/affine/sheafa.lisp @@ -276,7 +276,7 @@ (defun replace-genvar(&rest strings &aux tem hi) (loop for v in *genvar* when (and (atom (setq tem (get v 'disrep))) - (eq (aref (string v) 0) #\G) + (eql (aref (string v) 0) #\G) (cond (strings (strings-search strings (string tem))) (t t))) do diff --git a/share/contrib/lurkmathml/mathml.lisp b/share/contrib/lurkmathml/mathml.lisp index afed9d6..8dbdeb3 100644 --- a/share/contrib/lurkmathml/mathml.lisp +++ b/share/contrib/lurkmathml/mathml.lisp @@ -91,7 +91,7 @@ ((and itsalabel ;; but is it a user-command-label? - (eq (getcharn $inchar 2) (getcharn mexplabel 2))) + (eql (getcharn $inchar 2) (getcharn mexplabel 2))) ;; aha, this is a C-line: do the grinding: (format texport "<pre>~%~a " mexplabel) ;; need to get rid of "<" signs diff --git a/share/contrib/maximaMathML/PrMathML.lisp b/share/contrib/maximaMathML/PrMathML.lisp index e6dbbea..e2af770 100644 --- a/share/contrib/maximaMathML/PrMathML.lisp +++ b/share/contrib/maximaMathML/PrMathML.lisp @@ -443,7 +443,7 @@ (let* ((fx (cadr mexpress)) (f (and (not (atom fx)) (atom (caar fx)) (caar fx))) (bascdr (and f (cdr fx))) (expon (caddr mexpress)) - (doit (and f (member (char (string f) 0) (list #\% #\$) :test #'eq) + (doit (and f (member (char (string f) 0) (list #\% #\$)) (not (member f '(%sum %product) :test #'eq))))) (cond (doit (cond ;;;; sin^2 x case diff --git a/share/contrib/maximaMathML/mathml-maxima.lisp b/share/contrib/maximaMathML/mathml-maxima.lisp index 5e36c59..6018f1c 100644 --- a/share/contrib/maximaMathML/mathml-maxima.lisp +++ b/share/contrib/maximaMathML/mathml-maxima.lisp @@ -214,8 +214,8 @@ (last-char (aref s (1- (length s))))) (if (and - (or (eq first-char #\") (eq first-char #\')) - (eq last-char first-char)) + (or (eql first-char #\") (eql first-char #\')) + (eql last-char first-char)) (subseq (subseq s 1) 0 (- (length s) 2)) s)))) diff --git a/share/contrib/namespaces/namespaces.lisp b/share/contrib/namespaces/namespaces.lisp index 0744cda..ed4671b 100644 --- a/share/contrib/namespaces/namespaces.lisp +++ b/share/contrib/namespaces/namespaces.lisp @@ -478,7 +478,7 @@ (get-dissym-1 b c)))))) ; NEW (defun get-dissym-1 (b c) ; NEW - (if (eq (car b) #\space) ; NEW + (if (eql (car b) #\space) ; NEW (cons #\space (append c (cons #\| (rest b)))) ; NEW (append c (cons #\| b)))) ; NEW diff --git a/share/numericalio/numericalio.lisp b/share/numericalio/numericalio.lisp index ac3f897..fe65874 100644 --- a/share/numericalio/numericalio.lisp +++ b/share/numericalio/numericalio.lisp @@ -304,7 +304,7 @@ ((not (null sign)) (format t "numericalio: trailing sign (~S) at end of line; strange, but just eat it.~%" sign))) (cond - ((eq sep-ch #\space) + ((eql sep-ch #\space) (return (cons '(mlist) LL))) (t (return (cons '(mlist) (appropriate-append L LL))))))) @@ -317,11 +317,11 @@ (setq token (m* sign token)) (setq sign nil))) (cond - ((eq sep-ch #\space) + ((eql sep-ch #\space) (setq LL (append LL (list token)))) (t (cond - ((eq token sep-ch) + ((eql token sep-ch) (setq L (appropriate-append L LL)) (setq LL nil)) (t @@ -360,7 +360,7 @@ (if found-sep-ch (return nil) (return 'eof))) - ((and (eq token sep-ch) (not (eq sep-ch #\space))) + ((and (eql token sep-ch) (not (eql sep-ch #\space))) (if (or found-sep-ch (eql initial-pos 0)) (progn (setq pushback-sep-ch token) diff --git a/share/tensor/itensor.lisp b/share/tensor/itensor.lisp index 7590475..1456534 100644 --- a/share/tensor/itensor.lisp +++ b/share/tensor/itensor.lisp @@ -190,7 +190,7 @@ (defun getcon (e) ;; Helper to obtain contractions on both the noun and verb form of E - (cond ((and (symbolp e) (eq (getcharn e 1) #\%)) (zl-get ($verbify e) 'contractions)) + (cond ((and (symbolp e) (eql (getcharn e 1) #\%)) (zl-get ($verbify e) 'contractions)) (t (zl-get e 'contractions)) ) ) diff --git a/src/commac.lisp b/src/commac.lisp index 6d1ac63..2d6946c 100644 --- a/src/commac.lisp +++ b/src/commac.lisp @@ -617,12 +617,12 @@ values") (let ((previous-tyi #\a)) (defun backslash-check (ch stream eof-option) - (if (eq previous-tyi #\\ ) + (if (eql previous-tyi #\\ ) (progn (setq previous-tyi #\a) ch) (setq previous-tyi - (if (eq ch #\\ ) + (if (eql ch #\\ ) (let ((next-char (peek-char nil stream nil eof-option))) - (if (or (eq next-char #\newline) (eq next-char #\return)) + (if (or (eql next-char #\newline) (eql next-char #\return)) (eat-continuations ch stream eof-option) ch)) ch)))) @@ -630,13 +630,13 @@ values") ; Eat line continuations until we come to something which doesn't match, or we reach eof. (defun eat-continuations (ch stream eof-option) (setq ch (tyi-raw stream eof-option)) - (do () ((not (or (eq ch #\newline) (eq ch #\return)))) + (do () ((not (or (eql ch #\newline) (eql ch #\return)))) (let ((next-char (peek-char nil stream nil eof-option))) - (if (and (eq ch #\return) (eq next-char #\newline)) + (if (and (eql ch #\return) (eql next-char #\newline)) (tyi-raw stream eof-option))) (setq ch (tyi-raw stream eof-option)) (let ((next-char (peek-char nil stream nil eof-option))) - (if (and (eq ch #\\ ) (or (eq next-char #\return) (eq next-char #\newline))) + (if (and (eql ch #\\ ) (or (eql next-char #\return) (eql next-char #\newline))) (setq ch (tyi-raw stream eof-option)) (return-from eat-continuations ch)))) ch)) diff --git a/src/macdes.lisp b/src/macdes.lisp index c534164..d6e909f 100644 --- a/src/macdes.lisp +++ b/src/macdes.lisp @@ -150,8 +150,8 @@ ($setify (cons '(mlist) (filter #'(lambda (x) - (cond ((eq (getcharn x 1) #\$) x) - ((eq (getcharn x 1) #\%) + (cond ((eql (getcharn x 1) #\$) x) + ((eql (getcharn x 1) #\%) ;; Change to a verb, when present. (if (setq y (get x 'noun)) y diff --git a/src/mlisp.lisp b/src/mlisp.lisp index 50f99a6..8088652 100644 --- a/src/mlisp.lisp +++ b/src/mlisp.lisp @@ -321,7 +321,7 @@ is EQ to FNNAME if the latter is non-NIL." (setq u (or (safe-getl (caar form) '(noun)) (and *nounsflag* - (and (symbolp (caar form)) (eq (getcharn (caar form) 1) #\%)) + (and (symbolp (caar form)) (eql (getcharn (caar form) 1) #\%)) (not (or (getl-lm-fcn-prop (caar form) '(subr)) (safe-getl (caar form) '(mfexpr*)))) (prog2 ($verbify (caar form)) diff --git a/src/simp.lisp b/src/simp.lisp index ad1377e..ce41120 100644 --- a/src/simp.lisp +++ b/src/simp.lisp @@ -1451,7 +1451,7 @@ ((and (member $logexpand '($all $super)) (consp y) (member (caar y) '(%product $product))) - (let ((new-op (if (eq (getcharn (caar y) 1) #\%) '%sum '$sum))) + (let ((new-op (if (eql (getcharn (caar y) 1) #\%) '%sum '$sum))) (simplifya `((,new-op) ((%log) ,(cadr y)) ,@(cddr y)) t))) ((and $lognegint (maxima-integerp y) diff --git a/src/suprv1.lisp b/src/suprv1.lisp index f597217..c7609d9 100644 --- a/src/suprv1.lisp +++ b/src/suprv1.lisp @@ -545,7 +545,7 @@ ((nonsymchk y '$alias)) ((eq x y) y) ; x is already the alias of y ; Not needed. We return the alias immediately if we already have one. -; ((not (eq (getcharn x 1) #\$)) +; ((not (eql (getcharn x 1) #\$)) ; (merror "-ed symbols may not be aliased. ~M" x)) ((get x 'reversealias) (if (not (eq x y)) ----------------------------------------------------------------------- Summary of changes: share/affine/sheafa.lisp | 2 +- share/contrib/lurkmathml/mathml.lisp | 2 +- share/contrib/maximaMathML/PrMathML.lisp | 2 +- share/contrib/maximaMathML/mathml-maxima.lisp | 4 ++-- share/contrib/namespaces/namespaces.lisp | 2 +- share/numericalio/numericalio.lisp | 8 ++++---- share/tensor/itensor.lisp | 2 +- src/commac.lisp | 12 ++++++------ src/macdes.lisp | 4 ++-- src/mlisp.lisp | 2 +- src/simp.lisp | 2 +- src/suprv1.lisp | 2 +- 12 files changed, 22 insertions(+), 22 deletions(-) hooks/post-receive -- Maxima CAS |