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

last2, last3 not available inside a break loop #2374

Closed
cdwensley opened this issue Apr 18, 2018 · 2 comments
Closed

last2, last3 not available inside a break loop #2374

cdwensley opened this issue Apr 18, 2018 · 2 comments

Comments

@cdwensley
Copy link
Contributor

This happens in a fresh 4.9.0 :-
gap> 1;2;3;[last,last2,last3];
1
2
3
[ 3, 2, 1 ]
gap> Error("to enter a break loop");
Error, to enter a break loop called from
not in any function at stdin:2
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> 1;2;3;[last,last2,last3];
1
2
3
[ 3, 3, 2 ]

When I queried this on Slack, Chris Jefferson replied:
Short answer, no. Longer answer, the "bug" is we have a variable called LastDepth, which lets you pick how many of the last variables are changed. In this case we have set LastDepth=1, which means only last is getting updated. Why would we ever want to support that?
The simple fix (you could test it) is to change the 4th argument to SHELL in error.g:240 from '1' to '3'.

This change has been made; testinstall and teststandard pass; and a PR has been made.

@olexandr-konovalov
Copy link
Member

@cdwensley shall this be closed now?

@cdwensley
Copy link
Contributor Author

Yes - covered by PR #2375 and #2379.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants