In case it is, my first feeling is. No bug, don't fix it. If a user
wants a proper variable name, he should use UnivariatePolynomial,
because that explicitly requires a variable name for the output.
Sorry, this is _very_ wrong. Any fixed name could clash with
user variable names, so library normally uses SUP. In several
cases user has no choice because SUP is the only thing.
Yes, clear.
In SUP the name is irrelevant. SUP is essentially for library developers.
SUP is most prominent case because it is widely used. But the
same problems appears with POLY/EXPR like domain nested one
in anothers. Those are less significant as in such case user
has more control of variable names. Also, interpreter forbids
several such combinations (but they are used by the library).
OK, but what is the exact problem of POLY or EXPR for a user or developer?
My understanding is that SUP is for internal purposes where the name of
the variable is irrelevant. And I do not see that in our algebra library
the use of SUP causes any problem.
It causes trouble if you start looking at "internal" stuff.
And there were bug reports about this (nothing recent,
apparently our users treat this as "unsolvable problem").
I agree, for debugging purposes it would be nice to be able to
distinguish from where a printed variable "?" comes from. But I do not
see why this requires a change in OutputForm.
If you do not accept that position, then another simple idea is that
for the variable name is only really a problem, if we have SUP(A) and SUP(B)
with different coefficient rings A and B. That, however, leads to two
instantiations of SUP, right? What about simply generating a new lisp symbol
with every instance of SUP and store it as a domain variable/constant. That
symbol would then be used for output. No need to change OutputForm.
That has many problems. One is getting unpredictable variable names.
Hmmm... what variable name would (SCOPE "?") give?
Another is that logically the same domain may be re-instantiated
effectlevely getting different name.
Yes. But why would that be a problem? For debugging purposes, it's
completely enough if one can figure out to what the printed "?" belongs
to and that would be easy if it prints as "%s3" or so.
Change to OutputForm is appropriate as only output is affected:
if nobody looks at output then new OutputForm will be unused...
You say it. If no output is produced, then everything is irrelevant.
But why constructing a new output form? Let's take SUP(R). In order to
be able for this domain to produce "(SCOPE "?") as an output form, it
would have to investigate the structure of R. Now let's suppose that can
be done. Then a formatter get's (SCOPE "?") and has to translate it into
something that looks like a variable, "?'" or "?1". However, SUP instead
of giving (SCOPE "?") could immediately use "?'" or "?1" as variable name.
The same can apply for Union(X, "failed"), although Union is a somewhat
special case.
I am not convinced that introducing a new marker in OutputForm is really
needed.
I also wonder how a domain/package can actually recognize that it would
have to output its variable as (SCOPE "?") instead of simply "?".
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/16594454-67f7-5dcc-3b8b-140e5bbc70d3%40hemmecke.org.