From: Robert D. <rob...@gm...> - 2025-05-17 19:26:36
|
Maxima's printf has a lot of great things going for it, mostly inherited from Common Lisp FORMAT. As wonderful as it is, FORMAT doesn't provide a way to define new format directives or redefine existing ones. At present the Maxima-specific directives (~h for bigfloat, ~m for 2-d pretty printer output) and redefined directives (~a and ~s for 1-d output) are implemented by effectively reimplementing some large part of FORMAT, in particular the stuff for looping. I have wondered about how to handle printf in a neater way, mostly with the goal of fixing bugs, although it's not out of the question to make it simpler to define or redefine additional directives. I wonder if it's thinkable to start with an existing FORMAT implementation and then bolt on the Maxima-specific bits. I haven't investigated. Or we could take a second look at the existing printf code and see if the looping stuff could be revised. At this point I'm interested to hear comments about this stuff at a high level -- we can work out details if we can arrive at a workable plan. FWIW & all the best. Robert |