Skip to content

Commit d5c8d20

Browse files
TomasRikerrtoy
authored andcommitted
comm.lisp: reorder some DEFMFUNs (define before 1st use)
Using a function $FOO before it is first defined results in a compiler warning and slightly less efficient code because the compiler macro is not yet defined and calls go through $FOO rather than FOO-IMPL.
1 parent 594d398 commit d5c8d20

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/comm.lisp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@
6161
"If TRUE allows DIFF(X~Y,T) to work where ~ is defined in
6262
SHARE;VECT where VECT_CROSS is set to TRUE.")
6363

64+
(defmfun $listp (x)
65+
(and (not (atom x))
66+
(not (atom (car x)))
67+
(eq (caar x) 'mlist)))
68+
69+
(defun atomchk (e fun 2ndp)
70+
(if (or (atom e) (eq (caar e) 'bigfloat))
71+
(merror (intl:gettext "~:M: ~Margument must be a non-atomic expression; found ~M") fun (if 2ndp "2nd " "") e)))
72+
73+
(defmfun $member (x e)
74+
(atomchk (setq e ($totaldisrep e)) '$member t)
75+
(if (memalike ($totaldisrep x) (margs e)) t))
76+
6477
(defmfun $substitute (new old &optional (expr nil three-arg?))
6578
(cond (three-arg? (maxima-substitute new old expr))
6679
(t
@@ -994,11 +1007,6 @@
9941007
(defun getop (x)
9951008
(or (and (symbolp x) (get x 'op)) x))
9961009

997-
(defmfun $listp (x)
998-
(and (not (atom x))
999-
(not (atom (car x)))
1000-
(eq (caar x) 'mlist)))
1001-
10021010
(defmfun $cons (x e)
10031011
(atomchk (setq e (format1 e)) '$cons t)
10041012
(simplifya (mcons-exp-args e (cons x (margs e))) t))
@@ -1035,14 +1043,6 @@
10351043
(list* (delsimp (car e)) (cadr e) args)
10361044
(cons (delsimp (car e)) args)))
10371045

1038-
(defmfun $member (x e)
1039-
(atomchk (setq e ($totaldisrep e)) '$member t)
1040-
(if (memalike ($totaldisrep x) (margs e)) t))
1041-
1042-
(defun atomchk (e fun 2ndp)
1043-
(if (or (atom e) (eq (caar e) 'bigfloat))
1044-
(merror (intl:gettext "~:M: ~Margument must be a non-atomic expression; found ~M") fun (if 2ndp "2nd " "") e)))
1045-
10461046
(defun format1 (e)
10471047
(cond (($listp e) e)
10481048
($inflag (specrepcheck e))

0 commit comments

Comments
 (0)