|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file:
;; http://anggtwu.net/MAXIMA/2025-dim-at.lisp.html
;; http://anggtwu.net/MAXIMA/2025-dim-at.lisp
;; (find-angg "MAXIMA/2025-dim-at.lisp")
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;;
;; (defun e () (interactive) (find-angg "MAXIMA/2025-dim-at.lisp"))
;; (defun d () (interactive) (find-ebuffer "*sly-db for sbcl<2> (thread 2)*"))
;; (defun m () (interactive) (find-ebuffer "*sly-mrepl for sbcl<2>*"))
;; (defun de () (interactive) (find-2a '(d) '(e)))
;; (find-maximagitgrep "grep --color=auto -niH --null -e displa-def $(cat .files.lisp)")
;; (find-maximagitgrep "grep --color=auto -niH --null -e dim-%at $(cat .files.lisp)")
;; (find-maximagitfile "src/displa.lisp" "(displa-def %at dim-%at 105. 105.)")
;; (find-maximagitfile "src/displa.lisp" "(defun dim-%at ")
;; (find-maximagitfile "src/displa.lisp" "(return-from dim-%at ")
;; (find-maximagitfile "src/displa.lisp" "(defun dim-%integrate ")
;; (find-maximagitfile "src/displa.lisp" "(defun dimension ")
;; (find-maximagitfile "src/displa.lisp" "(defun dimension-function ")
;; (find-maximagitfile "src/displa.lisp" "(defun displa ")
;; (find-es "lisp" "return-from")
;; (find-es "maxima" "at")
;; (find-es "maxima" "dim-foo-0")
;; «.myo» (to "myo")
;; «.foo» (to "foo")
;; «myo» (to ".myo")
;;
(defvar myo)
(defun myo-get (key) (cadr (assoc key myo)))
;;
(defun dim-%at (form result)
(prog (exp eqs (w 0) (h 0) (d 0) at-char)
(unless (= (length (cdr form)) 2)
(return-from dim-%at (dimension-function form result)))
(setq at-char (if (display2d-unicode-enabled) at-char-unicode (car (coerce $absboxchar 'list))))
(setq exp (dimension (cadr form) result lop '%at nil 0)
w width
h height
d depth)
(setq eqs (dimension (cond ((not (eq 'mlist (caar (caddr form)))) (caddr form))
((null (cddr (caddr form))) (cadr (caddr form)))
(t (cons '(mcomma) (cdaddr form))))
nil 'mparen 'mparen nil 0))
;;
;; (setq myo `((form ,form) (result ,result) (exp ,exp) (eqs ,eqs) (w ,w) (h ,h) (d ,d)))
;; (break)
(setq myo `((n 3) (eqs ,eqs) (result ,result) (width ,width) (height ,height) (depth ,depth)))
;;
(unless (checkfit (+ 1 w width))
(return (dimension-function form result)))
(setq result (cons (cons 0 (cons (- 0 1 d) eqs))
(cons `(d-vbar ,(1+ h) ,(1+ d) ,at-char) exp))
width (+ 1 w width)
height (1+ h)
depth (+ 1 d depth))
(setq myo `((n 4) (eqs ,eqs) (result ,result) (width ,width) (height ,height) (depth ,depth)))
;; (princ `((n 4) (eqs ,eqs) (result ,result) (width ,width) (height ,height) (depth ,depth)))
(update-heights height depth)
(setq myo `((n 5) (eqs ,eqs) (result ,result) (width ,width) (height ,height) (depth ,depth)))
(prin1 myo)
(terpri)
(return result)))
#|
* (eepitch-sly)
* (eepitch-kill)
* (eepitch-sly)
*
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("startsly");
load("2025-dim-at.lisp");
o : 'at(f(x),x=a);
untrace();
* (eepitch-sly)
* (sly-connect "localhost" 56789)
* (eepitch-to-buffer "*sly-mrepl for sbcl<3>*")
myo
(myo-get 'result)
* (eepitch-sbcl)
* (eepitch-kill)
* (eepitch-sbcl)
(load "2025-dim-at.lisp")
(update-heights 2 1)
;; ((RESULT ((0 -1 #\a #\ #\= #\ #\x))) (WIDTH 10) (HEIGHT 2) (DEPTH 1))
res("abc");
to_lisp();
(myo-get 'result)
(myo-get 'newresult)
(myo-get 'form)
(coerce "abc" 'list)
($print #$res()$)
(to-maxima)
** (find-lisptree "lisptree.mac")
load ("~/lisptree/lisptree.mac");
o : 'at(f(x),x=a);
format0(o);
to_lisp();
(myo-get 'result)
(to-maxima)
|#
;; «foo» (to ".foo")
(defvar myr)
(displa-def $foo dim-$foo)
(defun dim-$foo (form result) (declare (ignorable form result)) (reverse myr))
(defun print-$foo () (prin1 myr) (terpri) ($print #$foo()$) "")
(defmacro print-foo (result &rest rest) `(progn ,@rest (setq myr ,result) (print-$foo)))
;; (defmacro print-oof (result &rest rest) `(print-foo (reverse ,result) ,@rest))
(defun s (str) (coerce str 'list))
(defun sr (str) (reverse (coerce str 'list)))
(defun abc () (s "abc"))
(defun def () (s "def"))
#|
* (eepitch-sly)
* (eepitch-kill)
* (eepitch-sly)
*
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("startsly");
load("2025-dim-at.lisp");
*
* (sly-connect "localhost" 56789)
* (eepitch-sly)
(load "2025-dim-at.lisp")
(let ((myr (abc))) (print-$foo))
(print-foo (abc))
(print-foo `(,@(abc) (2 0) ,@(def)))
(print-foo `(,@(abc) (2 1) ,@(def)))
(print-foo `(,@(abc) (2 2) ,@(def)))
(print-foo `(,@(abc) (d-vbar 1 0 #\│) ,@(def)))
(print-foo `(,@(abc) (d-vbar 2 0 #\│) ,@(def)) (princ 42))
(let ((break nil))
(print-foo (myr1))
(print-foo (myr1) (update-heights 2 1))
(print-foo (reverse (myr1)) (update-heights 2 1))
(print-foo (reverse (myr1)))
)
(let ((break t))
(print-foo `(,@(abc) (d-vbar 2 1 #\│) ,@(def) ,@(s "ghi")))
)
(defvar plaft)
plaft
(print-$foo)
|#
(defun my-result ()
`(;; ,@(s "(%o5) ")
;; (0 0)
,@(s "f(x)")
(D-VBAR 2 1 #\BOX_DRAWINGS_LIGHT_VERTICAL)
(0 -1 ,@(sr "x = a"))
(-5 1 ,@(sr "x = b"))))
(defun dim-$foo (form result)
(declare (ignorable form result))
(update-heights 2 1)
;; (my-result)
;; (reverse (my-result))
(dimension-function form (reverse (my-result)))
)
;; (dimension-function form this)))
;; (defun height+ (n) (setq
;; height+
;; depth+
;; width+
;; (show: height depth)
;; s
#|
Hi list,
(declare (ignorable form result)) (reverse myr))
(defun dim-$foo (form result) (declare (ignorable form result)) (reverse myr))
(defun print-$foo () (prin1 myr) (terpri) ($print #$foo()$) "")
(defmacro print-foo (result &rest rest) `(progn ,@rest (setq myr ,result) (print-$foo)))
;; (defmacro print-oof (result &rest rest) `(print-foo (reverse ,result) ,@rest))
(defun abc () (s "abc"))
(defun def () (s "def"))
(load "2025-dim-at.lisp")
|#