No warning when renaming to a special name used by Geogebra
I think the title explains well the reason for the problem and how to fix it.
As for the possible outputs of this situation I can't be exhaustive.
In the first attached file a segment has been renamed "Line" and there is also a line called f whose definition is "Line(C, D)". If you try to change this definition to "Line (C, A) then f turns into a number with the definition "Line(C)".
Similar bugs can be triggered using different methods, in some cases once one line have already been turned into a number it can be enough to just select a line, display its settings, click in the definition field without changing anything and then click elsewhere to turn this line into a number.
I joined a second file to show similar bug with the command "Midpoint". To trigger the bug load the file "Rename bug 2" then try to change the definition of the point C from "Midpoint(A, B)" to "Midpoint(A, D)" and then C becomes an undefined object with the definition "Midpoint(A)".
I guess any command used by Geogebra can lead to similar bug.
As for a possible treatment for this problem as I suggested in the title maybe Geogebra should display a warning message when renaming to a special name with a special meaning for Geogebra. That's the idea that came to me from the point of view of a Geogebra user.
But that's just a suggestion, I am no programmer and furthermore I don't know the internal structure of Geogebra's functioning. Maybe that idea might be difficult to implement, maybe it might get the software slower, maybe there are other ways to prevent such bugs with a better pros/cons situation.
Here are also some explanations about the specific conditions which led me to this bug.
Firstly there is kind of a bug in the French language, the name "droite" can both means "on the right side" (not the left one) or "line". At some point I wanted to rename some objects and for one of them the thing that characterize it mainly was that the object was on the right side, so I just went for the name "Droite". Then it managed to trigger bugs because I wanted to change the definition of some lines and with Geogebra configured in french the command to define a line is also "Droite".
I guess there can be some similar traps in every language and Geogebra surely uses a lot of different names as commands so it increases the risks of such bugs.
Also I encountered this bug while trying to model a graphical shape. This shape include many small elements disposed according to patterns. In order to get my bearings I renamed all the objecs to names that makes sense for this graphical shape. And doing many renaming also increases risks of bugs related to renaming.
So those bugs might only occur on some rare cases, anyway maybe there can be a way to prevent them with a good pros/cons situation.
Sorry, it works for me. Please say exactly what you did to get the error
An answer about using captions to avoid this problem :
Indeed captions offer a way to show what you want on the graphic without having to change the name. But one may want to be able to easily identify objects in the Algebra panel. But in this panel it is not possible to identify or sort objects according to their captions, so for this purpose the best solution seems to change the name of objects.
Anyway captions might be a way to improve Geogebra for this problem, being able to identify and sort objects according to their caption would avoid the need for renaming therefore limit the risk of bugs related to renaming.
So thanks jumera for this idea and sorry I did not replied earlier about your captions idea.
Thanks, I see - it's not a bug (as we can't disallow names for all commands in all (possible future) languages)
Once you've made eg MidPoint then MidPoint(...) is interpreted as MidPoint * (...)
Another important aspect of this problem is that it can be sneaky.
When you rename an object to a name which is also a command used by Geogebra nothing special happens.
In the example of the file "Rename bug 1.ggb" you can even build new lines without problems if you use tools from the toolbar.
It might be only later that bugs happens.
My recent experience is that in a big file with many objects I carelessly renamed a segment "Droite". But there was no visible problem at the moment and I build maybe 30 more objects without any problem. It's only when I wanted to change the definition of some lines that something weird happened. I thought that changing the definition of an object was only possible in some conditions or maybe that the fact that there were many objects gave problems to Geogebra. I had hard times understanding the real source of those bugs, actually I tried many things to avoid this bug. Then I thought I might ask for help on Geogebra forums and I thought I should try to be as precise as possible about what was happening. So I kind of did some debugging and managed to find the real source of those problems myself. It was a relief for the file I was working on. And I thought maybe it should be possible to avoid this problem to happen to other people.
Comments have been locked on this page!