From: Eduardo O. <edu...@gm...> - 2022-08-04 16:01:21
|
Hi all, I finally wrote a small program in Maxima that I think that is worth sharing - in the sense of it having a screenshot, a github page, and other such things. At this moment it is in these three files - the .htmls are more readable: http://angg.twu.net/MAXIMA/luatree.mac.html http://angg.twu.net/MAXIMA/luatree.lisp.html http://angg.twu.net/MAXIMA/luatree.lua.html http://angg.twu.net/MAXIMA/luatree.mac http://angg.twu.net/MAXIMA/luatree.lisp http://angg.twu.net/MAXIMA/luatree.lua Can I ask a basic question on style? Here it goes... Right now all paths are hardcoded. I run it from Maxima like this: load("~/MAXIMA/luatree.mac"); MV2 : 'integrate(fp(g(x))*gp(x), x, a, b) = 'integrate(fp(u), u, g(a), g(b)); luatree(MV2); The .mac file loads a Lisp file by running this, load("~/MAXIMA/luatree.lisp"); and a function in the .lisp file runs this: (uiop:run-program "~/MAXIMA/luatree.lua" :input s :output :lines) Can you recommend me good ways to de-hardcode these paths, and make everything work by requiring only that the three files be put in the same directory? Btw, the output of the "luatree(MV2);" above is this: =___________________. | | integrate__.__.__. integrate__.__.__. | | | | | | | | *___. x a b fp u g g | | | | | gp fp u a b | | x g | x Thanks in advance! =) Eduardo Ochs http://angg.twu.net/eev-maxima.html |