1 ;;;symbols and which should not appear in an eq form
2 ;(EVAL-WHEN (LOAD COMPILE EVAL)
3 ; (DEFVAR USER:*SYMBOLS*
4 ; '(GLOBAL:flonum GLOBAL:'flonum GLOBAL:'list
5 ; GLOBAL:list GLOBAL:'string GLOBAL:string
6 ; GLOBAL:'atom GLOBAL:atom GLOBAL:'array
7 ; GLOBAL:array GLOBAL:'fixnum GLOBAL:fixnum ))
10 ;;;symbols and which should not appear in an eq form
13 ;(defun check-non-keywords (form)
14 ; (loop for v in user:*symbols* when (MACSYMA:appears-in form v)
15 ; do (RETURN (warn () "~S appears in ~S argument to ~S ; should you use the keyword form?"
16 ; v form (car form)))))
19 ;(DEFUN check-arg-for-kw (arg)
20 ; (cond ((atom arg)(COND ((memq arg user:*symbols*) arg)))
24 ; (quote (loop for v in ARG when (member v user:*symbols*)
26 ; (t (loop for v in arg when (member v user:*symbols*)
30 ;(defmacro make-obsolete (function reason)
32 ; (defprop ,function obsolete style-checker)
33 ; (defprop ,function ,(string-append "is an obsolete function; " reason) obsolete)))
39 ;(putprop 'global:EQUAL 'compiler:check-non-keywords 'compiler:style-checker)
40 ;(putprop 'global:eq 'compiler:check-non-keywords 'compiler:style-checker)
41 ;(putprop 'global:memq 'compiler:check-non-keywords 'compiler:style-checker)
42 ;(putprop 'global:member 'compiler:check-non-keywords 'compiler:style-checker)
43 ;(putprop 'global:typep 'compiler:check-non-keywords 'compiler:style-checker)
46 (defun clear-keyword-check ()
47 (loop for v in '(eq equal memq zl-MEMBER ml-typep) do (remprop v 'compiler:style-checker)))
51 ;;;replace '("#/a" . "#\a")...
52 ;'(("#/"" . "double-quote-char")
53 ; ("#/;" . "semi-colon-char")
54 ; ("#//" . "forward-slash-char")
55 ; ("#/\" . "back-slash-char"))
57 ;replacements for multiple query replace from buffer
58 ;"#\;" "semi-colon-char"
59 ;"#\\" "back-slash-char"
60 ;"#\//" "forward-slash-char"
61 ;"#\/"" "double-quote-char"
62 ;"#\)" "right-parentheses-char"
63 ;"#\(" "left-parentheses-char"
65 ;"#\|" "vertical-stroke-char"
66 ;try to eliminate "how /"are/" you constructs"
68 ;;(shadow '(=) 'maxima)
70 ;;First pass with string-delimited-search = string-search
71 ;;and also to fix the package and syntax header. Do any
74 ; ("package: macsyma" . "mode: lisp; package: cl-maxima; syntax: common-lisp")
75 ; ("package:macsyma" . "mode: lisp; package: cl-maxima; syntax: common-lisp")
79 ;;evaluate the following in zetalisp syntax!!.
81 ;("#\;" . "#. semi-colon-char")
82 ;("#\\" . "#. back-slash-char")
83 ;("#\//" . "#. forward-slash-char")
84 ;("#\/"" . "#. double-quote-char")
85 ;("#\)" . "#. right-parentheses-char")
86 ;("#\(" . "#. left-parentheses-char")
87 ;("#\." . "#. period-char")
88 ;("#\|" . "#. vertical-stroke-char")
91 ; ;("MEMQ" . "zl-MEMQ")
92 ; ;("ASSQ" . "ZL-ASSQ")
93 ; ("DELETE" . "zl-DELETE")
94 ; ("EVERY" . "ZL-EVERY") ;;actually all occurrences are now cl:every, there were no zl-every.
95 ; ("MAKE-ARRAY" . "ZL-MAKE-ARRAY")
96 ; ("MEMBER" . "zl-MEMBER")
97 ; ("ASSOC" . "zl-ASSOC")
100 ; ("MEMBER" . "zl-MEMBER")
101 ; ("NLISTP" . "atom")
102 ; ("NINTERSECTION" . "zl-NINTERSECTION")
103 ; ("NUNION" . "zl-NUNION")
104 ; ("RASSOC" . "zl-RASSOC")
106 ; ("REMOVE" . "zl-REMOVE")
107 ; ("SOME" . "zl-SOME") ;;check were any cl:some?
108 ; ("UNION" . "zl-UNION")
109 ; ("\" . "fixnum-remainder")
110 ; ("\\" . "fixnum-gcd")
111 ; ("//\" . "fixnum-remainder")
112 ; ("typep" . "ml-typep")
113 ; ( "terminal-io" . "*terminal-io*")
114 ; ( "standard-input" . "*standard-input*")
115 ; ( "standard-output" . "*standard-output*")
116 ; ( "query-io" . "*query-io*")
117 ; ( "base" . "*print-base*")
118 ; ( "ibase" . "*read-base*")
119 ; ( "(*nopoint t)" . "print-radix*") ;;catch a few..
122 ;;Now replace any how/:are/:you type expressions.
124 ;These still need shadow.
125 ; LET ;;"CL-MAXIMA-SOURCE: MAXIMA; LET" ;;like let
126 ; LET* ;;"CL-MAXIMA-SOURCE: MAXIMA; LET" ;;maxima:let* does destructuring. very little used, and should remove
127 ; LISTEN ;;"CL-MAXIMA-SOURCE: MAXIMA; SUPRV" ;;has trivial definition in suprv (listen any) ==> 0
128 ; SIGNUM ;;"CL-MAXIMA-SOURCE: MAXIMA; COMMAC" ;same except (cl:signum 1.3)==1.0 not 1 but I think this is ok for macsyma
129 ; MAKE-ARRAY ;;"CL-MAXIMA-SOURCE: MAXIMA; COMMAC" ;maxima has zetalisp and common lisp make-array type syntax occurring uggh.
131 ;;MAY 2, 1985. HAVE REPLACED THESE
132 ;("CONSTANTP" . "MAXIMA-CONSTANTP") ;;"CL-MAXIMA-SOURCE: MAXIMA; SIMP" ;different
133 ;("ERROR" . "MAXIMA-ERROR") ;;"CL-MAXIMA-SOURCE: MAXIMA; COMMAC"
134 ;("FIND" . "MAXIMA-FIND") ;;"CL-MAXIMA-SOURCE: MAXIMA; LMSUP" ;different
135 ;("float-precision" . "MAXIMA-float-precision") ;;"CL-MAXIMA-SOURCE: MAXIMA; cpoly" ;?
136 ;("INTEGERP" . "MAXIMA-INTEGERP") ;;"CL-MAXIMA-SOURCE: MAXIMA; compar" ;different
137 ;("RATIONALIZE" . "MAXIMA-RATIONALIZE");;"CL-MAXIMA-SOURCE: MAXIMA; RAT3E" ;different
138 ;("RATIONALP" . "MAXIMA-RATIONALP") ;;"CL-MAXIMA-SOURCE: MAXIMA; LAPLAC" ;different
139 ;("REDUCE" . "MAXIMA-REDUCE") ;;"CL-MAXIMA-SOURCE: MAXIMA; trigi" ;different
140 ;("REM" . "MAXIMA-REM") ;;"CL-MAXIMA-SOURCE: MAXIMA; MRGMAC" ;different
141 ;("REMF" . "MAXIMA-REMF") ;;"CL-MAXIMA-SOURCE: MAXIMA; DB" ;different
142 ;("SLEEP" . "MAXIMA-SLEEP") ;;"CL-MAXIMA-SOURCE: MAXIMA; COMPAT"
143 ;("SUBSTITUTE" . "MAXIMA-SUBSTITUTE") ;;"CL-MAXIMA-SOURCE: MAXIMA; COMM" ;different
144 ;;*nopoint and *print-radix* want *nopoint =t <==> *print-radix* = nil uggh.
146 ;("vector" . "maxima-vector") ;; for the plotll and friends.
147 ;;and define zl-delete appropriately, perhaps as a macro or as the
148 ;;zetalisp definition if still available. at this stage new code could
149 ;;start to use the common lisp delete. The header on each file (so
150 ;;converted) should now indicate common lisp syntax.
152 ;;III. Then eventually,eventually replace expressions like (zl-member a b)
153 ;;by (member a b :test 'equal)
154 ;;when that becomes efficient. It could be left as a macro.
157 ;;The following are in the maxima package and have definitions in common lisp which may
158 ;;conflict with the maxima definitions
162 ;((RATIONALP . "MAXIMA-SOURCE: MAXIMA; LAPLAC") ;different
163 ; (SIGNUM . "MAXIMA-SOURCE: MAXIMA; COMMAC") ;same except (cl:signum 1.3)==1.0 not 1 but I think this is ok for macsyma
164 ; (FIND . "MAXIMA-SOURCE: MAXIMA; LMSUP") ;different
165 ; ( ATAN . "zetalisp sources") ;; (global:atan y x) == (cl:atan y x) + 2 pi if latter is negative
166 ; (ERROR . "MAXIMA-SOURCE: MAXIMA; COMMAC")
167 ; (ARRAY . "MAXIMA-SOURCE: MAXIMA; COMMAC") ;not a function in common lisp but symbol in the package
168 ; ;;array may be a good candidate for function replace since we want to replace function like occurences
171 ; (TYPECASE . "MAXIMA-SOURCE: MAXIMA; COMMAC") ;remove old occurrences
172 ; (MAKE-ARRAY . "MAXIMA-SOURCE: MAXIMA; COMMAC") ;treat as delete etc.
173 ; (TYPEP . "MAXIMA-SOURCE: MAXIMA; COMMAC") ;maxima wants something different. Needs own typep.
174 ; (LET* . "MAXIMA-SOURCE: MAXIMA; LET") ;;maxima:let* does destructuring. very little used, and should remove
175 ; (LET . "MAXIMA-SOURCE: MAXIMA; LET") ;;like let
176 ; (LISTEN . "MAXIMA-SOURCE: MAXIMA; SUPRV") ;;has trivial definition in suprv (listen any) ==> 0
177 ; (REM . "MAXIMA-SOURCE: MAXIMA; MRGMAC") ;different
178 ; (REMF . "MAXIMA-SOURCE: MAXIMA; DB") ;different
179 ; (CONSTANTP . "MAXIMA-SOURCE: MAXIMA; SIMP") ;different
180 ; (RATIONALIZE . "MAXIMA-SOURCE: MAXIMA; RAT3E") ;different
181 ; (SLEEP . "MAXIMA-SOURCE: MAXIMA; COMPAT")
182 ; (SUBSTITUTE . "MAXIMA-SOURCE: MAXIMA; COMM") ;different
185 ;;different but current defs useless
186 ; (NAMESTRING . "MAXIMA-SOURCE: MAXIMA; LMSUP") ;different ;;probably remove the macsyma defs
187 ; (TRUENAME . "MAXIMA-SOURCE: MAXIMA; TRANSS") ;;probably remove the macsyma defs
190 ; (TANH . "MAXIMA-SOURCE: MAXIMA; TRIGI") ;same
191 ; (COSH . "MAXIMA-SOURCE: MAXIMA; TRIGI") ;same
192 ; (SINH . "MAXIMA-SOURCE: MAXIMA; TRIGI") ;same
193 ; (TAN . "MAXIMA-SOURCE: MAXIMA; TRIGI") ;;same
194 ; (INT-CHAR (DEFUN-IF-NEW "MAXIMA-SOURCE: MAXIMA; COMMAC") ;can remove when have cl chars.
195 ; (DEFUN "MAXIMA-SOURCE: MAXIMA; COMMAC"))
196 ; (COERCE . "MAXIMA-SOURCE: MAXIMA; COMMAC") ;can remove