Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file: ;; http://anggtwu.net/MAXIMA/ppshort.lisp.html ;; http://anggtwu.net/MAXIMA/ppshort.lisp ;; (find-angg "MAXIMA/ppshort.lisp") ;; Author: Richard Fateman ;; Small changes by: Eduardo Ochs <eduardoochs@gmail.com> ;; Date: 2024oct29 ;; ;; From: (find-maximamsg "58834949 202410 29" "RFateman: ppshort.lisp") ;; https://sourceforge.net/p/maxima/mailman/message/58834949/ ;; Make Maxima general form expression more lisp-like ;; (defun shorten (r) (cond ((atom r) r) (t (cons (caar r) (mapcar #'shorten (cdr r)))))) (defun shortmore (r) (cond ((atom r) (shortatom r)) (t (mapcar #'shortmore r)))) (defun shortatom (r) (cond ((eq r 'mtimes) '*) ((eq r 'mplus) '+) ((eq r 'mexpt) '^) ;; etc (t r))) (defun $pp (r) (pprint (shortmore (shorten r)))) #| * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) load("ppshort.lisp"); q:ratsimp((a+b+c+1)^10); pp(q); |# ;; Local Variables: ;; coding: utf-8-unix ;; End: