On Sun, Apr 07, 2024 at 06:05:39AM +0200, Grégory Vanuxem wrote:
>
> It is possible to modify some parameters to Float output routines,
> what about returning the previous settings? For example
> outputSpacing(n) returns Void but if you want to temporarily modify
> this setting, in Spad for example, reverting to the user setting is
> not possible. I attached a proof of concept patch that implements
> this. In fact, even the macro 'separator ==> underscore()$Character'
> could also be parametrable, it is not in this diff though.
Thinking more about this: it should be possible to restore _whole_
previous settings. So probably we need something like:
get_output_mode : () -> Record(mode : String, prec : String)
othewise, after
outputFixed()
n := outputGeneral(12)
we have no clue that previous mode was "fixed". Also, '-1' is
valid as precion, but to set arbitrary valid precision one
would have to use code like
if prec = -1 then
outputFixed()
else
outputFixed(prec::NonNegativeInteger)
And to set desired mode we would need chain of tests. So it seems
that we need funtion
set_output_mode : (Stiring, Integer) -> Record(mode : String, prec : String)
which sets desired mode. I wrote above version that returns old settings,
but in principle version that returns Void is enough given 'get_output_mode'.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/ZhrXjcZjjYNYTu_E%40fricas.org.