On 27.04.23 15:49, Waldek Hebisch wrote:
This is part of public disscusion, so back to the list.
I'm sorry. I must have hit the wrong botton on my mailer.
The above is confusing because polynomial coercions are confusing
(they "move" variables up and down).
Hmmm... Let me say something general. I already said that I find your
patch an improvement. When I wrote the mail, I was already thinking
about how difficult it is to implement what I would prefer.
SUP comes without variable name. Period. If one wants names then one
should use UP.
OTOH, I an not sure if making innermost variable first is better.
Well, it wouldn't confuse me in the most common cases when I embed a
SUP(R) into another SUP, but whether naming the variables inside out or
outside in is not really much different. The whole stuff is for
debugging only. And there it helps even if the name of the variable
changes when I coerce from SUP(R) to SUP(SUP(R)) or back. One must be
very careful anyway at debugging time. In fact, having this, I would
even be bold and claiming that changing the default to ?, ?2, ?3, etc.
where ? is outermost ?2 is second level etc. would actually be fully
enough for debugging. I think that setting variable names is a
nice-to-have, but wouldn't be vital if the question mark variable names
come with numbers that specify the depth of the scope.
If that goes in, it will go together with test which can serve as
example. Also, 'scope' is part of internal machinery which should be
ignorable except for folks that implement things like SUP.
Yes, yes. I usually do not much distiguish between user and developer
documentation, but anyway, I very much like that code is documented for
developer explaining the reason why something was introduced. There
should be a link to the mailing list or even a short explanation (i.e.
"--" comments near the place where scope is implemented. And if it is
not for the general user, then the ++ docstring should mention that
scope is intended for internal purpose.
Rather, user visible functionality is accessed via
'set_replacements'. Concerning documentation, if this is deemed
useful enough we could add a paragraph to FriCAS book to explain the
problem and solution.
Yes. But it's pretty uninteresting and should go into a developer section.
For people curious why we have some function generic way is to try
break things. Remove the function or redefine it. Then run tests.
If no test breaks, then maybe function has no purpose. Or, more
likely, there is deficiency in our tests.
We certainly have enough deficiencies in our tests (not every part of
FriCAS is covered), but if you patch breaks one test, then the test is
also bad, because relying on the output of SUP is not a good test.
Wouldn't it make sense that if someone use set_replacements and the
provided list is too short that one could continue with using "?1",
"?2" etc. for the next names?
It makes sense. Simply, it is not clear how far we want to go.
Oh, infinity. Just count the scopes and whenever you need a variable,
then generate one with prepending ? to the number of scopes and use that
variable, if there is none left in the user provided variable names
list. That should be pretty easy to implement.
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/a38e870d-13e6-06ff-d890-b612c8d61f92%40hemmecke.org.