Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file: ;; http://anggtwu.net/MAXIMA/lazynouns.lisp.html ;; http://anggtwu.net/MAXIMA/lazynouns.lisp ;; (find-angg "MAXIMA/lazynouns.lisp") ;; Author: Eduardo Ochs <eduardoochs@gmail.com> ;; ;; Introduction ;; ============ ;; This file defines "lazy nouns" for "diff", "integrate", and "*". ;; Nouns are "less active" than verbs. ;; Lazy nouns are "less active" than nouns. ;; Nouns do some simplifications. ;; My lazy nouns don't simplify anything. ;; ;; Compare: ;; diff(f(x),x) <- here "diff" is a verb ;; 'diff(f(x),x) <- here "'diff" is a noun ;; diff(x^3,x) <- calculates a derivative ;; 'diff(x^3,x) <- returns an uncalculated derivative ;; diff(1,x) <- simplifies to 0 ;; 'diff(1,x) <- also simplifies to 0 =( ;; diff_(1,x) <- returns d1/dx, does not simplify ;; ;; See: (find-maximanode "Nouns and Verbs") ;; (find-angg "MAXIMA/dim-2.lisp") (defun my-copy-properties (tosymbol fromsymbol keys) (loop for key in keys do (setf (get tosymbol key) (get fromsymbol key)))) (my-copy-properties '$diff_ '%derivative '(dimension tex)) (my-copy-properties '$integrate_ '%integrate '(dimension tex)) ($infix "*." 120 120) ($nary "*.") (my-copy-properties '|$*.| 'mtimes '($nary lbp rbp dimension dissym tex texsym)) #| * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) load("lazynouns.lisp"); [o1,o2] : [2*x^3, 1]; matrix(["", "diff", "'diff", "diff_"], [o1, diff(o1,x), 'diff(o1,x), diff_(o1,x)], [o2, diff(o2,x), 'diff(o2,x), diff_(o2,x)]); [o1,o2] : [2*f(x), 2*x]; matrix(["", "integrate", "'integrate", "integrate_"], [o1, integrate(o1,x), 'integrate(o1,x), integrate_(o1,x)], [o2, integrate(o2,x), 'integrate(o2,x), integrate_(o2,x)]); matrix(["*", "*."], [2*3*4*5, 2*.3*.4*.5], [a*c*d*b, a*.c*.d*.b]); |#