Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViewString for enumerator uses method for list #2658

Open
markuspf opened this issue Jul 24, 2018 · 4 comments
Open

ViewString for enumerator uses method for list #2658

markuspf opened this issue Jul 24, 2018 · 4 comments
Labels
kind: bug Issues describing general bugs, and PRs fixing them

Comments

@markuspf
Copy link
Member

markuspf commented Jul 24, 2018

Using GAP in the terminal, viewing an enumerator behaves reasonably:

gap> e := Enumerator(SymmetricGroup(5));
<enumerator of perm group>
gap> ViewObj(e);
<enumerator of perm group>

But the method selected for ViewString is the one for a list, and hence the enumerator is expanded. This is not what we want:

ViewString returns a string which would be displayed by ViewObj (6.3-5) for an object.

gap> e := Enumerator(SymmetricGroup(5));
<enumerator of perm group>
gap> ViewString(e);
"[ (),\<\> (1,\<\>5),\<\> (1,\<\>2,\<\>5),\<\> (1,\<\>3,\<\>5),\<\> (1,\<\>4,\<\>5),\
\<\> (2,\<\>5),... (continues for another 50 lines or so)

See gap-packages/JupyterKernel#72

@stevelinton stevelinton added the kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them label Jul 30, 2018
@fingolfin fingolfin added the kind: bug Issues describing general bugs, and PRs fixing them label Mar 21, 2019
@fingolfin
Copy link
Member

I just became aware of this issue, and to be frank, I don't understand what it is about. What is wrong? Please amend the issue description to explain that.

@fingolfin fingolfin added status: awaiting response Issues and PRs whose progress is stalled awaiting a response from (usually) the author and removed kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them labels Mar 26, 2019
@ChrisJefferson
Copy link
Contributor

This shows the problem:

gap> e := Enumerator(SymmetricGroup(5));;
gap> ViewString(e);
"[ (),\<\> (1,\<\>5),\<\> (1,\<\>2,\<\>5),\<\> (1,\<\>3,\<\>5),\<\> (1,\<\>4,\<\>5),\
\<\> (2,\<\>5),... (continues for another 50 lines or so)

@wilfwilson wilfwilson removed the status: awaiting response Issues and PRs whose progress is stalled awaiting a response from (usually) the author label Apr 6, 2019
@wilfwilson
Copy link
Member

I updated the issue description and removed the status: awaiting response label, since I feel that the issue is now sufficiently clear.

@ThomasBreuer
Copy link
Contributor

I think this issue has the following aspects.

  • Design and documentation of enumerators in IsEnumeratorByFunctions should be changed
    such that a ViewString component is supported.
  • Analogously, support PrintString.
  • Analogously, do the same for IsIteratorByFunctions.
  • Objects in IsEnumeratorByFunctions and IsIteratorByFunctions need
    ViewString and PrintStringmethods analogous to their ViewObj and PrintObj methods.
  • Concerning the JupyterKernel context, the problem is more general.
    A change as proposed in prefer ViewObj to ViewString (temporarily) gap-packages/JupyterKernel#104
    would provide a temporary solution to problems of this kind
    until sufficiently many ViewString methods are available.

If this sounds reasonable then I can create a pull request for the changes sketched above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Issues describing general bugs, and PRs fixing them
Projects
None yet
Development

No branches or pull requests

6 participants