You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the sake of simplicity, let us consider just View, Print, and Display.
(In order to implement a solution, once we agree on it, of course ViewString, PrintString, and DisplayString have to be adjusted accordingly.)
First, the reason for the above output is that OnePrimitiveGroup sets the Name attribute of its output.
The documentation of Name says the following.
‣ Name( obj ) ──────────────────────────────────────────────────── attribute
returns the name, a string, previously assigned to obj via a call to SetName
(12.8-1). The name of an object is used only for viewing the object via this
name.
There are no methods installed for computing names of objects, but the name
may be set for suitable objects, using SetName (12.8-1).
According to this text, I would say that the Print and Display output shown above are not o.k.
The documentation of Print says that often the output is GAP readable in the sense that reading it will reconstruct the object, and this is how Leaonard wants to use Print in this situation.
Besides that, my interpretation of the text is that SetName should be called only by users, not inside functions like OnePrimitiveGroup.
The attribute StructureDescription gives an example how one can affect only the View result without interfering with Name: If the attribute StructureDescription is set for a group then a ViewObj method that shows its value is applicable, but still the known Name value has priority. A known StructureDescription value does not affect Print and Display.
(One could get the idea to change OnePrimitiveGroup to set StructureDescription instead of Name. I think this would not be o.k. because StructureDescription promises a certain format of its output.)
The text was updated successfully, but these errors were encountered:
O.k., there is no consensus yet how to solve the problem.
So we have to decide what we want. I see the following alternatives.
Keep the current PrintObj method that uses with high priority a stored Name value, document this behaviour, and change the primgrp package such that PrimitiveGroup does no longer set Name.
Remove the current PrintObj method that uses with high priority a stored Name value, state clearly in the documentation that a known Name is used by View but never by Print, and adjust all places in the library (and packages) where Name is currently set in order to be used by Print; as sketched above, this holds for global objects such as Rationals.
Replace the current PrintObj method that uses with high priority a stored Name value by one that uses a stored Name value only in special situations. For example, we can introduce a new filter IsPrintedViaName, and the PrintObj method becomes applicable only for objects in this filter. Then we can set this filter for Rationals etc., in order to get the old behaviour for these objects. We should then recommend that IsPrintedViaName gets set only interactively or in functions that create objects such as Rationals.
(Or are there perhaps better ideas?)
Variant 1. means an easy change in the documentation plus a request to change the primgrp package.
Variant 2. requires to decide how the Print behaviour for objects such as Rationals shall be implemented; variant 3. would be an answer to this question.
In a message to the GAP Forum, Leonard Soicher mentioned that printing certain groups in GAP looks strange.
For the sake of simplicity, let us consider just
View
,Print
, andDisplay
.(In order to implement a solution, once we agree on it, of course
ViewString
,PrintString
, andDisplayString
have to be adjusted accordingly.)First, the reason for the above output is that
OnePrimitiveGroup
sets theName
attribute of its output.The documentation of
Name
says the following.According to this text, I would say that the
Print
andDisplay
output shown above are not o.k.The documentation of
Print
says that often the output is GAP readable in the sense that reading it will reconstruct the object, and this is how Leaonard wants to usePrint
in this situation.Besides that, my interpretation of the text is that
SetName
should be called only by users, not inside functions likeOnePrimitiveGroup
.The attribute
StructureDescription
gives an example how one can affect only theView
result without interfering withName
: If the attributeStructureDescription
is set for a group then aViewObj
method that shows its value is applicable, but still the knownName
value has priority. A knownStructureDescription
value does not affectPrint
andDisplay
.(One could get the idea to change
OnePrimitiveGroup
to setStructureDescription
instead ofName
. I think this would not be o.k. becauseStructureDescription
promises a certain format of its output.)The text was updated successfully, but these errors were encountered: