To see an example where domain variables are set, see here.
https://github.com/fricas/fricas/blob/master/src/algebra/fmt.spad#L1596
https://github.com/fricas/fricas/blob/master/src/algebra/fmt.spad#L1678
You should decide on the return type according to your wishes. Sometimes
it is interesting if the set-function returns the value that was in the
variable before it is overridden by the new value.
If you are not interested in any value then declare the function like this
foo: A -> Void
and write
foo(a: A): Void ==
...
void()
Knowing that the "digits" function changes the behaviour of Float, you
could have found out yourself yourself how to work with domain variables.
https://github.com/fricas/fricas/blob/master/src/algebra/float.spad#L137
https://github.com/fricas/fricas/blob/master/src/algebra/float.spad#L542
https://github.com/fricas/fricas/blob/master/src/algebra/float.spad#L542
Actually, I would strongly recomment agains such domain variables unless
you have a very good reason to have it, because then your domain behaves
differently to a user depending on a hidden variable.
Ralf
--
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/2a07418b-1da1-36ab-00db-a0943b725e03%40hemmecke.org.