From: Dieter K. <cra...@us...> - 2009-11-25 23:42:00
|
Update of /cvsroot/maxima/maxima/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14113/src Modified Files: mopers.lisp Log Message: Cutting out the code from the macro take which bypasses the simplifier. Adding a macro take* which does not assume simplified arguments for future use. No problems with the testsuite and share_testsuite. Index: mopers.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/mopers.lisp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- mopers.lisp 13 Mar 2009 17:47:02 -0000 1.9 +++ mopers.lisp 25 Nov 2009 23:41:44 -0000 1.10 @@ -98,18 +98,23 @@ ;; (TAKE '(%SIN) A) --> (SIMP-%SIN (LIST '(%SIN) A) 1 T) (defmacro take (operator &rest args) - (let ((simplifier (and (not (atom operator)) - (eq (car operator) 'quote) - (cdr (assoc (caadr operator) '((%atan . simp-%atan) - (%tan . simp-%tan) - (%log . simpln) - (mabs . simpabs) - (%sin . simp-%sin) - (%cos . simp-%cos) - ($atan2 . simpatan2)) :test #'eq))))) - (if simplifier - `(,simplifier (list ,operator ,@args) 1 t) - `(simplifya (list ,operator ,@args) t)))) +; Cutting out the code which bypasses the simplifier. +; (let ((simplifier (and (not (atom operator)) +; (eq (car operator) 'quote) +; (cdr (assoc (caadr operator) '((%atan . simp-%atan) +; (%tan . simp-%tan) +; (%log . simpln) +; (mabs . simpabs) +; (%sin . simp-%sin) +; (%cos . simp-%cos) +; ($atan2 . simpatan2)) :test #'eq))))) +; (if simplifier +; `(,simplifier (list ,operator ,@args) 1 t) + `(simplifya (list ,operator ,@args) t)) + +;; take* does not assume that the arguments are simplified. +(defmacro take* (operator &rest args) + `(simplifya (list ,operator ,@args) nil)) (defmacro min%i () ''((mtimes simp) -1 $%i)) ;-%I (defmacro 1//2 () ''((rat simp) 1 2)) ;1/2 |