|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file:
;; http://anggtwu.net/MAXIMA/2025-addsimp.lisp.html
;; http://anggtwu.net/MAXIMA/2025-addsimp.lisp
;; (find-angg "MAXIMA/2025-addsimp.lisp")
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;;
;; (defun e () (interactive) (find-angg "MAXIMA/2025-addsimp.lisp"))
;; (find-maximamsg "59242116 202510 04" "Edrx: Idiomatic way to add a SIMP when needed?")
;; (find-maximamsg "59242429 202510 05" "RDodier: Idiomatic way to add a SIMP when needed?")
;; https://mail.google.com/mail/u/0/#sent/QgrcJHsBtPbWGTFVCldhxtLGQngvclFCgGv
;; (find-es "maxima" "addsimp")
(defun addsimp-inner (flags)
(if (member 'simp flags)
flags
(cons 'simp flags)))
(defun addsimp (o)
"Convert ((a b c) d e) to ((a simp b c) d e)."
(if (consp o)
(let* ((abc (car o))
(a (car abc))
(bc (cdr abc))
(de (cdr o))
(simp-bc (addsimp-inner bc)))
`((,a ,@simp-bc) ,@de))))
#|
* (eepitch-sbcl)
* (eepitch-kill)
* (eepitch-sbcl)
(load "2025-addsimp.lisp")
(addsimp '((a bc) de))
(addsimp '((a b c) d e))
(addsimp '((mtimes flag1 flag2 flag3) foo bar))
(addsimp '((mtimes flag1 simp flag3) foo bar))
|#
;; Local Variables:
;; coding: utf-8-unix
;; End: