From: Eduardo O. <edu...@gm...> - 2025-04-27 22:23:32
|
Hi all, especially Michael and Richard, this is a continuation of this other thread, from a few days ago, that was about the data structures used by functions like `dim-%at', `dim-%integrate', and `dim-$matrix'... https://sourceforge.net/p/maxima/mailman/message/59177191/ https://sourceforge.net/p/maxima/mailman/message/59177280/ https://sourceforge.net/p/maxima/mailman/message/59177328/ I am still struggling with the basics, but at least I found a nice way to write my questions... if we run this in a Maxima REPL, to_lisp(); (defun s (str) (coerce str 'list)) (defun sr (str) (reverse (coerce str 'list))) (defun my-result () `(,@(s "f(x)") (D-VBAR 2 1 #\|) (0 -1 ,@(sr "x = a")) (-5 1 ,@(sr "x = b")))) (displa-def $foo dim-$foo) (defun dim-$foo (form result) (format t "form: ~S~&result: ~S~&" form result) (update-heights 2 1) (reverse (my-result))) (to-maxima) foo(3, "4"); We get: (%i2) foo(3, "4"); form: (($FOO SIMP) 3 "4") result: ((0 0) #\ #\) #\2 #\o #\% #\() |x = b f(x)| |x = a (%i3) Note that the "f(x)|..." is left aligned, instead of being centered and preceded by an "(%o2)". That's because the `dim-*' functions sometimes return with a: (return (dimension-function form result))) and sometimes with just this... (return result))) What does `dimension-function' do? I found it very hard to understand, to debug with Sly, and to test in other ways... Thanks in advance! Eduardo Ochs |